{"name":"assertion-error","description":"Error constructor for test and validation frameworks that implements standardized AssertionError specification.","dist-tags":{"latest":"1.1.0"},"versions":{"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","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"},"_id":"assertion-error@1.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.8.0","dist":{"integrity":"sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==","shasum":"e60b6b0e8f301bd97e5375215bda406c85118c0b","tarball":"http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBLKjetp37+0lhhi9deyZvXmBZcF/3rW0uJJtY/162bGAiA/3giMIaJv7sRAruur386mr5e9OzyX7FBDJo6ugT1cxQ=="}]},"directories":{}}},"readme":"

\n AssertionError and AssertionResult classes.\n

\n\n

\n \n \n \n \n \n \n \n

\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\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 `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 [Deno.land](https://deno.land/x/assertion_error)\n\n```typescript\nimport {AssertionError, AssertionResult} from 'https://deno.land/x/assertion_error@2.0.0/mod.ts'\n```\n","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"},"homepage":"https://github.com/chaijs/assertion-error#readme","bugs":{"url":"https://github.com/chaijs/assertion-error/issues"},"license":"MIT","readmeFilename":"README.md"}