{"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":{"integrity":"sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==","shasum":"f641a196b335690b1070bf00b6e7593fec190bf7","tarball":"http://registry-npm.ywwl.com/assertion-error/download/assertion-error-2.0.1.tgz","fileCount":5,"unpackedSize":5832,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBRJCTrR95tAeT97y/jwEH/TYBmhXoWLCu5LGkLt/20gIgeZjIf2gTu0Glu/2z4g2rUscWL0j6COoTNZdxrSpcXZQ="}],"size":2472,"noattachment":false,"key":"/assertion-error/-/assertion-error-2.0.1.tgz"},"_npmUser":{"name":"chaijs","email":"chaijs@keithcirkel.co.uk"},"directories":{},"maintainers":[{"name":"chaijs","email":"chaijs@keithcirkel.co.uk"},{"name":"keithamus","email":"npm@keithcirkel.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/assertion-error_2.0.1_1697652253337_0.3545746301491721"},"_hasShrinkwrap":false,"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","publish_time":1697652253507,"_cnpm_publish_time":1697652253507,"dist-tags":{"latest":"2.0.1"}}