{"_id":"assert-okam","_rev":"3463190","name":"assert-okam","description":"The node.js assert module, re-packaged for web browsers.","dist-tags":{"latest":"1.5.0"},"maintainers":[{"name":"sorrycc","email":""}],"time":{"modified":"2024-08-27T19:36:30.000Z","created":"2023-07-24T06:49:40.715Z","1.5.0":"2023-07-24T07:01:45.569Z","2.0.0":"2023-07-24T06:49:40.715Z"},"users":{},"repository":{"type":"git","url":"git://github.com/browserify/commonjs-assert.git"},"versions":{"1.5.0":{"name":"assert-okam","description":"The node.js assert module, re-packaged for web browsers.","version":"1.5.0","dependencies":{"object-assign":"^4.1.1","util":"0.10.3"},"devDependencies":{"mocha":"~1.21.4","zuul":"~3.10.0","zuul-ngrok":"^4.0.0"},"homepage":"https://github.com/browserify/commonjs-assert","keywords":["assert","browser"],"license":"MIT","main":"./assert.js","repository":{"type":"git","url":"git://github.com/browserify/commonjs-assert.git"},"scripts":{"browser-local":"zuul --no-coverage --local 8000 -- test.js","test":"npm run test-node && npm run test-browser","test-browser":"zuul -- test.js","test-native":"TEST_NATIVE=true mocha --ui qunit test.js","test-node":"mocha --ui qunit test.js"},"bugs":{"url":"https://github.com/browserify/commonjs-assert/issues"},"_id":"assert-okam@1.5.0","_nodeVersion":"18.14.0","_npmVersion":"9.6.5","dist":{"shasum":"c697095e6ba2d97dc9b02a6ad1464e3668a471bc","size":10159,"noattachment":false,"key":"/assert-okam/-/assert-okam-1.5.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/assert-okam/download/assert-okam-1.5.0.tgz"},"_npmUser":{"name":"sorrycc","email":"sorrycc@gmail.com"},"directories":{},"maintainers":[{"name":"sorrycc","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/assert-okam_1.5.0_1690182105292_0.8734940080688509"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-07-24T07:01:45.569Z","publish_time":1690182105569,"_source_registry_name":"default","_cnpm_publish_time":1690182105569},"2.0.0":{"name":"assert-okam","version":"2.0.0","description":"The assert module from Node.js, for the browser.","main":"build/assert.js","license":"MIT","homepage":"https://github.com/browserify/commonjs-assert","repository":{"type":"git","url":"git+https://github.com/browserify/commonjs-assert.git"},"scripts":{"build":"babel assert.js test.js --out-dir build && babel internal --out-dir build/internal && babel test --out-dir build/test","dev":"babel assert.js test.js --watch --out-dir build & babel internal --watch --out-dir build/internal & babel test --watch --out-dir build/test","test":"npm run build && npm run test:nobuild","test:nobuild":"node build/test.js","test:source":"node test.js","test:browsers":"airtap build/test.js","test:browsers:local":"npm run test:browsers -- --local"},"keywords":["assert","browser"],"devDependencies":{"@babel/cli":"^7.4.4","@babel/core":"^7.4.4","@babel/preset-env":"^7.4.4","airtap":"^2.0.2","array-fill":"^1.2.0","core-js":"^3.0.1","cross-env":"^5.2.0","object.entries":"^1.1.0","object.getownpropertydescriptors":"^2.0.3","tape":"^4.10.1"},"dependencies":{"es6-object-assign":"^1.1.0","is-nan":"^1.2.1","object-is":"^1.0.1","util":"^0.12.0"},"bugs":{"url":"https://github.com/browserify/commonjs-assert/issues"},"_id":"assert-okam@2.0.0","_nodeVersion":"18.14.0","_npmVersion":"9.6.5","dist":{"shasum":"6f66a59187a0421835e5ca218e18da1e7a1fd889","size":19889,"noattachment":false,"key":"/assert-okam/-/assert-okam-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/assert-okam/download/assert-okam-2.0.0.tgz"},"_npmUser":{"name":"sorrycc","email":"sorrycc@gmail.com"},"directories":{},"maintainers":[{"name":"sorrycc","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/assert-okam_2.0.0_1690181380532_0.0770860259439432"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-07-24T06:49:40.715Z","publish_time":1690181380715,"_source_registry_name":"default","_cnpm_publish_time":1690181380715}},"readme":"# assert\n\n[![Build Status](https://travis-ci.org/browserify/commonjs-assert.svg?branch=master)](https://travis-ci.org/browserify/commonjs-assert)\n\nThis module is used for writing unit tests for your applications, you can access it with `require('assert')`.\n\nIt aims to be fully compatibe with the [node.js assert module](http://nodejs.org/api/assert.html), same API and same behavior, just adding support for web browsers.\nThe API and code may contain traces of the [CommonJS Unit Testing 1.0 spec](http://wiki.commonjs.org/wiki/Unit_Testing/1.0) which they were based on, but both have evolved significantly since then.\n\nA `strict` and a `legacy` mode exist, while it is recommended to only use `strict mode`.\n\n## Strict mode\n\nWhen using the `strict mode`, any `assert` function will use the equality used in the strict function mode. So `assert.deepEqual()` will, for example, work the same as `assert.deepStrictEqual()`.\n\nIt can be accessed using:\n\n```js\nconst assert = require('assert').strict;\n```\n\n## Legacy mode\n\n> Deprecated: Use strict mode instead.\n\nWhen accessing `assert` directly instead of using the `strict` property, the\n[Abstract Equality Comparison](https://tc39.github.io/ecma262/#sec-abstract-equality-comparison) will be used for any function without a\n\"strict\" in its name (e.g. `assert.deepEqual()`).\n\nIt can be accessed using:\n\n```js\nconst assert = require('assert');\n```\n\nIt is recommended to use the `strict mode` instead as the Abstract Equality Comparison can often have surprising results. Especially\nin case of `assert.deepEqual()` as the used comparison rules there are very lax.\n\nE.g.\n\n```js\n// WARNING: This does not throw an AssertionError!\nassert.deepEqual(/a/gi, new Date());\n```\n\n\n## assert.fail(actual, expected, message, operator)\nThrows an exception that displays the values for actual and expected separated by the provided operator.\n\n## assert(value, message), assert.ok(value, [message])\nTests if value is truthy, it is equivalent to assert.equal(true, !!value, message);\n\n## assert.equal(actual, expected, [message])\nTests shallow, coercive equality with the equal comparison operator ( == ).\n\n## assert.notEqual(actual, expected, [message])\nTests shallow, coercive non-equality with the not equal comparison operator ( != ).\n\n## assert.deepEqual(actual, expected, [message])\nTests for deep equality.\n\n## assert.deepStrictEqual(actual, expected, [message])\nTests for deep equality, as determined by the strict equality operator ( === )\n\n## assert.notDeepEqual(actual, expected, [message])\nTests for any deep inequality.\n\n## assert.strictEqual(actual, expected, [message])\nTests strict equality, as determined by the strict equality operator ( === )\n\n## assert.notStrictEqual(actual, expected, [message])\nTests strict non-equality, as determined by the strict not equal operator ( !== )\n\n## assert.throws(block, [error], [message])\nExpects block to throw an error. error can be constructor, regexp or validation function.\n\nValidate instanceof using constructor:\n\n```javascript\nassert.throws(function() { throw new Error(\"Wrong value\"); }, Error);\n```\n\nValidate error message using RegExp:\n\n```javascript\nassert.throws(function() { throw new Error(\"Wrong value\"); }, /value/);\n```\n\nCustom error validation:\n\n```javascript\nassert.throws(function() {\n    throw new Error(\"Wrong value\");\n}, function(err) {\n    if ( (err instanceof Error) && /value/.test(err) ) {\n        return true;\n    }\n}, \"unexpected error\");\n```\n\n## assert.doesNotThrow(block, [message])\nExpects block not to throw an error, see assert.throws for details.\n\n## assert.ifError(value)\nTests if value is not a false value, throws if it is a true value. Useful when testing the first argument, error in callbacks.\n","_attachments":{},"homepage":"https://github.com/browserify/commonjs-assert","bugs":{"url":"https://github.com/browserify/commonjs-assert/issues"},"license":"MIT"}