{"_id":"assertion-error","_rev":"3324802","name":"assertion-error","description":"Error constructor for test and validation frameworks that implements standardized AssertionError specification.","dist-tags":{"latest":"2.0.1"},"maintainers":[{"name":"chaijs","email":"chaijs@keithcirkel.co.uk"}],"time":{"modified":"2024-06-11T09:31:46.000Z","created":"2013-04-07T22:59:42.826Z","2.0.1":"2023-10-18T18:04:13.507Z","2.0.0":"2021-10-05T15:20:51.185Z","1.1.0":"2018-01-07T14:59:31.257Z","1.0.2":"2016-06-06T18:25:29.009Z","1.0.1":"2015-03-05T23:45:54.576Z","1.0.0":"2013-06-08T20:41:17.202Z","0.1.0":"2013-04-07T22:59:42.826Z"},"users":{},"author":{"name":"Jake Luer","email":"jake@qualiancy.com","url":"http://qualiancy.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/chaijs/assertion-error.git"},"versions":{"2.0.1":{"name":"assertion-error","version":"2.0.1","description":"Error constructor for test and validation frameworks that implements standardized AssertionError specification.","author":{"name":"Jake Luer","email":"jake@qualiancy.com","url":"http://qualiancy.com"},"license":"MIT","types":"./index.d.ts","keywords":["test","assertion","assertion-error"],"repository":{"type":"git","url":"git+ssh://git@github.com/chaijs/assertion-error.git"},"engines":{"node":">=12"},"type":"module","module":"index.js","main":"index.js","scripts":{"build":"deno bundle mod.ts > index.js","pretest":"rm -rf coverage/","test":"deno test --coverage=coverage","posttest":"deno coverage coverage --lcov > coverage/lcov.info && lcov --summary coverage/lcov.info"},"_id":"assertion-error@2.0.1","gitHead":"08a1f16ece0c5d4b916c9ce1479a776df0e203e0","bugs":{"url":"https://github.com/chaijs/assertion-error/issues"},"homepage":"https://github.com/chaijs/assertion-error#readme","_nodeVersion":"21.0.0","_npmVersion":"9.8.1","dist":{"shasum":"f641a196b335690b1070bf00b6e7593fec190bf7","size":2472,"noattachment":false,"key":"/assertion-error/-/assertion-error-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/assertion-error/download/assertion-error-2.0.1.tgz"},"_npmUser":{"name":"chaijs","email":"chaijs@keithcirkel.co.uk"},"directories":{},"maintainers":[{"name":"chaijs","email":"chaijs@keithcirkel.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/assertion-error_2.0.1_1697652253337_0.3545746301491721"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-10-18T18:04:13.507Z","publish_time":1697652253507,"_source_registry_name":"default","_cnpm_publish_time":1697652253507},"2.0.0":{"name":"assertion-error","version":"2.0.0","description":"Error constructor for test and validation frameworks that implements standardized AssertionError specification.","author":{"name":"Jake Luer","email":"jake@qualiancy.com","url":"http://qualiancy.com"},"license":"MIT","types":"./dist/mod.d.ts","keywords":["test","assertion","assertion-error"],"repository":{"type":"git","url":"git+ssh://git@github.com/chaijs/assertion-error.git"},"engines":{"node":">=12"},"type":"module","module":"./dist/mod.js","main":"./dist/mod.js","scripts":{"build":"tsc","pretest":"npm run build","test":"NODE_ENV=test node ./test/index.js"},"devDependencies":{"typescript":"^4.4.3"},"gitHead":"06761d175ab7d188c18c1c7ed1ea5ae4a6a4d52c","bugs":{"url":"https://github.com/chaijs/assertion-error/issues"},"homepage":"https://github.com/chaijs/assertion-error#readme","_id":"assertion-error@2.0.0","_nodeVersion":"16.8.0","_npmVersion":"7.21.0","dist":{"shasum":"791a05c4b3c3f70652b51dcda070b9ef89da662c","size":2421,"noattachment":false,"key":"/assertion-error/-/assertion-error-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/assertion-error/download/assertion-error-2.0.0.tgz"},"_npmUser":{"name":"chai","email":"chaijs@keithcirkel.co.uk"},"directories":{},"maintainers":[{"name":"chaijs","email":"chaijs@keithcirkel.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/assertion-error_2.0.0_1633447251025_0.35381096573804993"},"_hasShrinkwrap":false,"publish_time":1633447251185,"_cnpm_publish_time":1633447251185},"1.1.0":{"name":"assertion-error","version":"1.1.0","description":"Error constructor for test and validation frameworks that implements standardized AssertionError specification.","author":{"name":"Jake Luer","email":"jake@qualiancy.com","url":"http://qualiancy.com"},"license":"MIT","types":"./index.d.ts","keywords":["test","assertion","assertion-error"],"repository":{"type":"git","url":"git+ssh://git@github.com/chaijs/assertion-error.git"},"engines":{"node":"*"},"main":"./index","scripts":{"test":"make test"},"dependencies":{},"devDependencies":{"component":"*","typescript":"^2.6.1"},"gitHead":"faa3f8cbbdba74d2760f9d2e95c008ba9ce4812e","bugs":{"url":"https://github.com/chaijs/assertion-error/issues"},"homepage":"https://github.com/chaijs/assertion-error#readme","_id":"assertion-error@1.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.8.0","_npmUser":{"name":"chaijs","email":"chaijs@keithcirkel.co.uk"},"dist":{"shasum":"e60b6b0e8f301bd97e5375215bda406c85118c0b","size":2668,"noattachment":false,"key":"/assertion-error/-/assertion-error-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/assertion-error/download/assertion-error-1.1.0.tgz"},"maintainers":[{"name":"chaijs","email":"chaijs@keithcirkel.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/assertion-error-1.1.0.tgz_1515337170361_0.5846316555980593"},"directories":{},"publish_time":1515337171257,"_hasShrinkwrap":false,"_cnpm_publish_time":1515337171257},"1.0.2":{"name":"assertion-error","version":"1.0.2","description":"Error constructor for test and validation frameworks that implements standardized AssertionError specification.","author":{"name":"Jake Luer","email":"jake@qualiancy.com","url":"http://qualiancy.com"},"license":"MIT","keywords":["test","assertion","assertion-error"],"repository":{"type":"git","url":"git+ssh://git@github.com/chaijs/assertion-error.git"},"engines":{"node":"*"},"main":"./index","scripts":{"test":"make test"},"dependencies":{},"devDependencies":{"component":"*"},"gitHead":"b36f593951c1487fa33747c9911025734923f28c","bugs":{"url":"https://github.com/chaijs/assertion-error/issues"},"homepage":"https://github.com/chaijs/assertion-error#readme","_id":"assertion-error@1.0.2","_shasum":"13ca515d86206da0bac66e834dd397d87581094c","_from":".","_npmVersion":"3.8.9","_nodeVersion":"5.7.0","_npmUser":{"name":"chaijs","email":"chaijs@keithcirkel.co.uk"},"dist":{"shasum":"13ca515d86206da0bac66e834dd397d87581094c","size":2581,"noattachment":false,"key":"/assertion-error/-/assertion-error-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/assertion-error/download/assertion-error-1.0.2.tgz"},"maintainers":[{"name":"chaijs","email":"chaijs@keithcirkel.co.uk"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/assertion-error-1.0.2.tgz_1465237527264_0.8082898685242981"},"directories":{},"publish_time":1465237529009,"_cnpm_publish_time":1465237529009,"_hasShrinkwrap":false},"1.0.1":{"name":"assertion-error","version":"1.0.1","description":"Error constructor for test and validation frameworks that implements standardized AssertionError specification.","author":{"name":"Jake Luer","email":"jake@qualiancy.com","url":"http://qualiancy.com"},"license":"MIT","keywords":["test","assertion","assertion-error"],"repository":{"type":"git","url":"git@github.com:chaijs/assertion-error.git"},"engines":{"node":"*"},"main":"./index","scripts":{"test":"make test"},"dependencies":{},"devDependencies":{"component":"*"},"gitHead":"db10d2fc753f00b3dad24956921056eaf1e03708","bugs":{"url":"https://github.com/chaijs/assertion-error/issues"},"homepage":"https://github.com/chaijs/assertion-error","_id":"assertion-error@1.0.1","_shasum":"35aaeec33097f11f42399ecadf33faccd27f5c4c","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"jakeluer","email":"jake@alogicalparadox.com"},"maintainers":[{"name":"chaijs","email":"chaijs@keithcirkel.co.uk"}],"dist":{"shasum":"35aaeec33097f11f42399ecadf33faccd27f5c4c","size":2546,"noattachment":false,"key":"/assertion-error/-/assertion-error-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/assertion-error/download/assertion-error-1.0.1.tgz"},"directories":{},"publish_time":1425599154576,"_cnpm_publish_time":1425599154576,"_hasShrinkwrap":false},"1.0.0":{"name":"assertion-error","version":"1.0.0","description":"Error constructor for test and validation frameworks that implements standardized AssertionError specification.","author":{"name":"Jake Luer","email":"jake@qualiancy.com","url":"http://qualiancy.com"},"license":"MIT","keywords":["test","assertion","assertion-error"],"repository":{"type":"git","url":"git@github.com:chaijs/assertion-error.git"},"engines":{"node":"*"},"main":"./index","scripts":{"test":"make test"},"dependencies":{},"devDependencies":{"component":"*"},"readmeFilename":"README.md","bugs":{"url":"https://github.com/chaijs/assertion-error/issues"},"_id":"assertion-error@1.0.0","dist":{"shasum":"c7f85438fdd466bc7ca16ab90c81513797a5d23b","size":2485,"noattachment":false,"key":"/assertion-error/-/assertion-error-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/assertion-error/download/assertion-error-1.0.0.tgz"},"_from":".","_npmVersion":"1.2.23","_npmUser":{"name":"jakeluer","email":"jake@alogicalparadox.com"},"maintainers":[{"name":"chaijs","email":"chaijs@keithcirkel.co.uk"}],"directories":{},"publish_time":1370724077202,"_hasShrinkwrap":false,"_cnpm_publish_time":1370724077202},"0.1.0":{"name":"assertion-error","version":"0.1.0","description":"Error constructor for test and validation frameworks that implements standardized AssertionError specification.","author":{"name":"Jake Luer","email":"jake@qualiancy.com","url":"http://qualiancy.com"},"license":"MIT","keywords":[],"repository":{"type":"git","url":"git@github.com:qualiancy/assertion-error.git"},"engines":{"node":"*"},"main":"./index","scripts":{"test":"make test"},"dependencies":{},"devDependencies":{"component":"*"},"readmeFilename":"README.md","_id":"assertion-error@0.1.0","dist":{"shasum":"555cb007e89be44ba73e7b9600c3907dc381ce2b","size":2498,"noattachment":false,"key":"/assertion-error/-/assertion-error-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/assertion-error/download/assertion-error-0.1.0.tgz"},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"jakeluer","email":"jake@alogicalparadox.com"},"maintainers":[{"name":"chaijs","email":"chaijs@keithcirkel.co.uk"}],"directories":{},"publish_time":1365375582826,"_hasShrinkwrap":false,"_cnpm_publish_time":1365375582826}},"readme":"<p align=center>\n  AssertionError and AssertionResult classes.\n</p>\n\n<p align=center>\n  <a href=\"https://github.com/chaijs/assertion-error/actions\">\n    <img\n      alt=\"build:?\"\n      src=\"https://github.com/chaijs/assertion-error/actions/workflows/nodejs.yml/badge.svg\"\n    />\n  </a><a href=\"https://www.npmjs.com/package/assertion-error\">\n    <img\n      alt=\"downloads:?\"\n      src=\"https://img.shields.io/npm/dm/assertion-error.svg\"\n    />\n  </a><a href=\"\">\n    <img\n      alt=\"devDependencies:none\"\n      src=\"https://img.shields.io/badge/dependencies-none-brightgreen\"\n    />\n  </a>\n</p>\n\n## What is AssertionError?\n\nAssertion Error is a module that contains two classes: `AssertionError`, which\nis an instance of an `Error`, and `AssertionResult` which is not an instance of\nError.\n\nThese can be useful for returning from a function - if the function \"succeeds\"\nreturn an `AssertionResult` and if the function fails return (or throw) an\n`AssertionError`.\n\nBoth `AssertionError` and `AssertionResult` implement the `Result` interface:\n\n```typescript\ninterface Result {\n  name: \"AssertionError\" | \"AssertionResult\";\n  ok: boolean;\n  toJSON(...args: unknown[]): Record<string, unknown>;\n}\n```\n\nSo if a function returns `AssertionResult | AssertionError` it is easy to check\n_which_ one is returned by checking either `.name` or `.ok`, or check\n`instanceof Error`.\n\n## Installation\n\n### Node.js\n\n`assertion-error` is available on [npm](http://npmjs.org).\n\n```\n$ npm install --save assertion-error\n```\n\n### Deno\n\n`assertion_error` is available on\n[Deno.land](https://deno.land/x/assertion_error)\n\n```typescript\nimport {\n  AssertionError,\n  AssertionResult,\n} from \"https://deno.land/x/assertion_error@2.0.0/mod.ts\";\n```\n","_attachments":{},"homepage":"https://github.com/chaijs/assertion-error#readme","bugs":{"url":"https://github.com/chaijs/assertion-error/issues"},"license":"MIT"}