{"_id":"assert-never","_rev":"3635640","name":"assert-never","description":"Helper function for exhaustive checks of discriminated unions in TypeScript","dist-tags":{"latest":"1.3.0"},"maintainers":[{"name":"aikoven","email":""}],"time":{"modified":"2024-10-21T06:05:49.000Z","created":"2017-03-27T12:18:30.576Z","1.3.0":"2024-07-07T11:33:23.706Z","1.2.1":"2020-05-13T04:25:07.043Z","1.2.0":"2019-04-24T03:43:40.049Z","1.1.0":"2017-12-25T04:05:05.777Z","1.0.0":"2017-03-27T12:18:30.576Z"},"users":{},"author":{"name":"Daniel Lytkin","email":"dan.lytkin@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/aikoven/assert-never.git"},"versions":{"1.3.0":{"name":"assert-never","version":"1.3.0","description":"Helper function for exhaustive checks of discriminated unions in TypeScript","main":"index.js","typings":"index.d.ts","scripts":{"build":"tsc","prepublish":"npm run build && npm test","test":"jest"},"keywords":["typescript","discriminated unions","assert","never"],"repository":{"type":"git","url":"git+https://github.com/aikoven/assert-never.git"},"author":{"name":"Daniel Lytkin","email":"dan.lytkin@gmail.com"},"license":"MIT","devDependencies":{"@babel/core":"^7.24.7","@babel/preset-env":"^7.24.7","@babel/preset-typescript":"^7.24.7","@types/jest":"^29.5.12","babel-jest":"^29.7.0","jest":"^29.7.0","type-assertions":"^1.1.0","typescript":"^5.5.3"},"_id":"assert-never@1.3.0","gitHead":"129add29afae86f0d0fee1dab8f469c91a39b833","bugs":{"url":"https://github.com/aikoven/assert-never/issues"},"homepage":"https://github.com/aikoven/assert-never#readme","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"shasum":"c53cf3ad8fcdb67f400a941dea66dac7fe82dd2e","size":1430,"noattachment":false,"key":"/assert-never/-/assert-never-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/assert-never/download/assert-never-1.3.0.tgz"},"_npmUser":{"name":"aikoven","email":"dan.lytkin@gmail.com"},"directories":{},"maintainers":[{"name":"aikoven","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/assert-never_1.3.0_1720352003566_0.5486109919237372"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-07-07T11:33:23.706Z","publish_time":1720352003706,"_source_registry_name":"default","_cnpm_publish_time":1720352003706},"1.2.1":{"name":"assert-never","version":"1.2.1","description":"Helper function for exhaustive checks of discriminated unions in TypeScript","main":"index.js","typings":"index.d.ts","scripts":{"build":"tsc","prepublish":"npm run build"},"keywords":["typescript","discriminated unions","assert","never"],"repository":{"type":"git","url":"git+https://github.com/aikoven/assert-never.git"},"author":{"name":"Daniel Lytkin","email":"dan.lytkin@gmail.com"},"license":"MIT","devDependencies":{"typescript":"^2.2.1"},"gitHead":"a5197695021f865f8165bbe3b1a6803d20bb0fb6","bugs":{"url":"https://github.com/aikoven/assert-never/issues"},"homepage":"https://github.com/aikoven/assert-never#readme","_id":"assert-never@1.2.1","_nodeVersion":"13.13.0","_npmVersion":"6.14.4","dist":{"shasum":"11f0e363bf146205fb08193b5c7b90f4d1cf44fe","size":1230,"noattachment":false,"key":"/assert-never/-/assert-never-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/assert-never/download/assert-never-1.2.1.tgz"},"maintainers":[{"name":"aikoven","email":""}],"_npmUser":{"name":"aikoven","email":"dan.lytkin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/assert-never_1.2.1_1589343906939_0.7969730514777897"},"_hasShrinkwrap":false,"publish_time":1589343907043,"_cnpm_publish_time":1589343907043},"1.2.0":{"name":"assert-never","version":"1.2.0","description":"Helper function for exhaustive checks of discriminated unions in TypeScript","main":"index.js","typings":"index.d.ts","scripts":{"build":"tsc","prepublish":"npm run build"},"keywords":["typescript","discriminated unions","assert","never"],"repository":{"type":"git","url":"git+https://github.com/aikoven/assert-never.git"},"author":{"name":"Daniel Lytkin","email":"dan.lytkin@gmail.com"},"license":"MIT","devDependencies":{"typescript":"^2.2.1"},"gitHead":"981191bcdc603a0eb9833e952fc0c66c3ed67c3c","bugs":{"url":"https://github.com/aikoven/assert-never/issues"},"homepage":"https://github.com/aikoven/assert-never#readme","_id":"assert-never@1.2.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.0","_npmUser":{"name":"aikoven","email":"dan.lytkin@gmail.com"},"dist":{"shasum":"e6597ed9e357f7e62c074dfa7c71e30ed7b67a8b","size":1489,"noattachment":false,"key":"/assert-never/-/assert-never-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/assert-never/download/assert-never-1.2.0.tgz"},"maintainers":[{"name":"aikoven","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/assert-never_1.2.0_1556077419843_0.08649878638742847"},"_hasShrinkwrap":false,"publish_time":1556077420049,"_cnpm_publish_time":1556077420049},"1.1.0":{"name":"assert-never","version":"1.1.0","description":"Helper function for exhaustive checks of discriminated unions in TypeScript","main":"index.js","typings":"index.d.ts","scripts":{"build":"tsc","prepublish":"npm run build"},"keywords":["typescript","discriminated unions","assert","never"],"repository":{"type":"git","url":"git+https://github.com/aikoven/assert-never.git"},"author":{"name":"Daniel Lytkin","email":"dan.lytkin@gmail.com"},"license":"MIT","devDependencies":{"typescript":"^2.2.1"},"gitHead":"2f4387a213003fa64d5bf5afb21a34f72fee475a","bugs":{"url":"https://github.com/aikoven/assert-never/issues"},"homepage":"https://github.com/aikoven/assert-never#readme","_id":"assert-never@1.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.1","_npmUser":{"name":"aikoven","email":"dan.lytkin@gmail.com"},"dist":{"shasum":"e7ac87d6d0191f19f19694c1266a2dd5c9e3becb","size":1493,"noattachment":false,"key":"/assert-never/-/assert-never-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/assert-never/download/assert-never-1.1.0.tgz"},"maintainers":[{"name":"aikoven","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/assert-never-1.1.0.tgz_1514174704758_0.9342390205711126"},"directories":{},"publish_time":1514174705777,"_hasShrinkwrap":false,"_cnpm_publish_time":1514174705777},"1.0.0":{"name":"assert-never","version":"1.0.0","description":"Helper function for exhaustive checks of discriminated unions in TypeScript","main":"index.js","typings":"index.d.ts","scripts":{"build":"tsc","prepublish":"npm run build"},"keywords":["typescript","discriminated union"],"repository":{"type":"git","url":"git+https://github.com/aikoven/assert-never.git"},"author":{"name":"Daniel Lytkin","email":"dan.lytkin@gmail.com"},"license":"MIT","devDependencies":{"typescript":"^2.2.1"},"gitHead":"718d32467abe1d306005032ebee5711ec0caf525","bugs":{"url":"https://github.com/aikoven/assert-never/issues"},"homepage":"https://github.com/aikoven/assert-never#readme","_id":"assert-never@1.0.0","_shasum":"8071f3a681c81ffeafa6d5c2f3aa049a76b07226","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"aikoven","email":"dan.lytkin@gmail.com"},"dist":{"shasum":"8071f3a681c81ffeafa6d5c2f3aa049a76b07226","size":1578,"noattachment":false,"key":"/assert-never/-/assert-never-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/assert-never/download/assert-never-1.0.0.tgz"},"maintainers":[{"name":"aikoven","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/assert-never-1.0.0.tgz_1490617110006_0.048595757223665714"},"directories":{},"publish_time":1490617110576,"_cnpm_publish_time":1490617110576,"_hasShrinkwrap":false}},"readme":"# Assert Never [![npm version][npm-image]][npm-url]\n\nHelper function for [exhaustive checks][exhaustive-checks] of discriminated\nunions in TypeScript.\n\n## Installation\n\n```\nnpm install --save assert-never\n```\n\n## Usage\n\n```ts\nimport {assertNever} from \"assert-never\";\n\ntype A = {type: 'a'};\ntype B = {type: 'b'};\ntype Union = A | B;\n\nfunction doSomething(arg: Union) {\n  if (arg.type === 'a') {\n    return something;\n  }\n\n  if (arg.type === 'b') {\n    return somethingElse;\n  }\n\n  // TS will error if there are other types in the union\n  // Will throw an Error when called at runtime. Use `assertNever(arg, true)`\n  // instead to fail silently.\n  return assertNever(arg);\n}\n```\n\n[npm-image]: https://badge.fury.io/js/assert-never.svg\n[npm-url]: https://badge.fury.io/js/assert-never\n[exhaustive-checks]: https://basarat.gitbook.io/typescript/type-system/discriminated-unions#exhaustive-checks\n","_attachments":{},"homepage":"https://github.com/aikoven/assert-never#readme","bugs":{"url":"https://github.com/aikoven/assert-never/issues"},"license":"MIT"}