{"_id":"outvariant","_rev":"3551351","name":"outvariant","description":"Type-safe implementation of invariant with positionals.","dist-tags":{"latest":"1.4.3"},"maintainers":[{"name":"kettanaito","email":""}],"time":{"modified":"2024-09-19T02:43:01.000Z","created":"2021-06-30T23:48:13.097Z","1.4.3":"2024-07-05T10:02:08.996Z","1.4.2":"2023-12-14T10:11:13.344Z","1.4.1":"2023-12-14T10:05:30.239Z","1.4.0":"2023-03-23T16:46:05.093Z","1.3.0":"2022-03-20T23:34:52.848Z","1.2.1":"2021-08-25T11:00:08.759Z","1.2.0":"2021-08-04T15:08:17.271Z","1.1.0":"2021-08-02T13:40:31.954Z","1.0.5":"2021-08-01T22:33:58.320Z","1.0.4":"2021-07-02T10:52:42.386Z","1.0.3":"2021-07-01T00:10:17.311Z","1.0.2":"2021-07-01T00:04:08.357Z","1.0.1":"2021-07-01T00:02:30.622Z","1.0.0":"2021-06-30T23:48:13.097Z"},"users":{},"author":{"name":"Artem Zakharchenko"},"repository":{"type":"git","url":"https://github.com/open-draft/outvariant"},"versions":{"1.4.3":{"name":"outvariant","version":"1.4.3","description":"Type-safe implementation of invariant with positionals.","main":"lib/index.js","module":"lib/index.mjs","typings":"lib/index.d.ts","exports":{".":{"types":"./lib/index.d.ts","require":"./lib/index.js","default":"./lib/index.mjs"}},"author":{"name":"Artem Zakharchenko"},"license":"MIT","scripts":{"test":"jest","clean":"rimraf ./lib","build":"yarn clean && tsup","prepublishOnly":"yarn test && yarn build","release":"release publish"},"keywords":["invariant","outvariant","exception","positional"],"devDependencies":{"@ossjs/release":"^0.8.0","@types/jest":"^26.0.23","jest":"^27.0.6","rimraf":"^3.0.2","ts-jest":"^27.0.3","ts-node":"^10.0.0","tsup":"^6.2.3","typescript":"^4.3.4"},"repository":{"type":"git","url":"https://github.com/open-draft/outvariant"},"licenseText":"MIT License\n\nCopyright (c) 2021–present Artem Zakharchenko\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"outvariant@1.4.3","dist":{"shasum":"221c1bfc093e8fec7075497e7799fdbf43d14873","size":5832,"noattachment":false,"key":"/outvariant/-/outvariant-1.4.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/outvariant/download/outvariant-1.4.3.tgz"},"_npmUser":{"name":"kettanaito","email":"kettanaito@gmail.com"},"directories":{},"maintainers":[{"name":"kettanaito","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/outvariant_1.4.3_1720173728868_0.2995549978440817"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-07-05T10:02:08.996Z","publish_time":1720173728996,"_source_registry_name":"default","_cnpm_publish_time":1720173728996},"1.4.2":{"name":"outvariant","version":"1.4.2","description":"Type-safe implementation of invariant with positionals.","main":"lib/index.js","module":"lib/index.mjs","typings":"lib/index.d.ts","exports":{".":{"types":"./lib/index.d.ts","require":"./lib/index.js","default":"./lib/index.mjs"}},"author":{"name":"Artem Zakharchenko"},"license":"MIT","scripts":{"test":"jest","clean":"rimraf ./lib","build":"yarn clean && tsup","prepublishOnly":"yarn test && yarn build","release":"release publish"},"keywords":["invariant","outvariant","exception","positional"],"devDependencies":{"@ossjs/release":"^0.8.0","@types/jest":"^26.0.23","jest":"^27.0.6","rimraf":"^3.0.2","ts-jest":"^27.0.3","ts-node":"^10.0.0","tsup":"^6.2.3","typescript":"^4.3.4"},"repository":{"type":"git","url":"https://github.com/open-draft/outvariant"},"licenseText":"MIT License\n\nCopyright (c) 2021–present Artem Zakharchenko\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"outvariant@1.4.2","dist":{"shasum":"f54f19240eeb7f15b28263d5147405752d8e2066","size":5810,"noattachment":false,"key":"/outvariant/-/outvariant-1.4.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/outvariant/download/outvariant-1.4.2.tgz"},"_npmUser":{"name":"kettanaito","email":"kettanaito@gmail.com"},"directories":{},"maintainers":[{"name":"kettanaito","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/outvariant_1.4.2_1702548673188_0.30185503266183655"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-12-14T10:11:13.344Z","publish_time":1702548673344,"_source_registry_name":"default","_cnpm_publish_time":1702548673344},"1.4.1":{"name":"outvariant","version":"1.4.1","description":"Type-safe implementation of invariant with positionals.","main":"lib/index.js","module":"lib/index.mjs","typings":"lib/index.d.ts","exports":{".":{"types":"./lib/index.d.ts","require":"./lib/index.js","default":"./lib/index.mjs"}},"author":{"name":"Artem Zakharchenko"},"license":"MIT","scripts":{"test":"jest","clean":"rimraf ./lib","build":"yarn clean && tsup","prepublishOnly":"yarn test && yarn build","release":"release publish"},"keywords":["invariant","outvariant","exception","positional"],"devDependencies":{"@ossjs/release":"^0.8.0","@types/jest":"^26.0.23","jest":"^27.0.6","rimraf":"^3.0.2","ts-jest":"^27.0.3","ts-node":"^10.0.0","tsup":"^6.2.3","typescript":"^4.3.4"},"repository":{"type":"git","url":"https://github.com/open-draft/outvariant"},"licenseText":"MIT License\n\nCopyright (c) 2021–present Artem Zakharchenko\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"outvariant@1.4.1","dist":{"shasum":"29c28d60e82f1dd4315e3b7271bb78f931d2ed60","size":5758,"noattachment":false,"key":"/outvariant/-/outvariant-1.4.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/outvariant/download/outvariant-1.4.1.tgz"},"_npmUser":{"name":"kettanaito","email":"kettanaito@gmail.com"},"directories":{},"maintainers":[{"name":"kettanaito","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/outvariant_1.4.1_1702548330004_0.14102088583919214"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-12-14T10:05:30.239Z","publish_time":1702548330239,"_source_registry_name":"default","_cnpm_publish_time":1702548330239},"1.4.0":{"name":"outvariant","version":"1.4.0","description":"Type-safe implementation of invariant with positionals.","main":"lib/index.js","module":"lib/index.mjs","typings":"lib/index.d.ts","exports":{".":{"types":"./lib/index.d.ts","require":"./lib/index.js","default":"./lib/index.mjs"}},"author":{"name":"Artem Zakharchenko"},"license":"MIT","scripts":{"test":"jest","clean":"rimraf ./lib","build":"yarn clean && tsup","prepublishOnly":"yarn test && yarn build","release":"release publish"},"keywords":["invariant","outvariant","exception","positional"],"devDependencies":{"@ossjs/release":"^0.5.1","@types/jest":"^26.0.23","jest":"^27.0.6","rimraf":"^3.0.2","ts-jest":"^27.0.3","ts-node":"^10.0.0","tsup":"^6.2.3","typescript":"^4.3.4"},"repository":{"type":"git","url":"https://github.com/open-draft/outvariant"},"licenseText":"MIT License\n\nCopyright (c) 2021–present Artem Zakharchenko\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"outvariant@1.4.0","dist":{"shasum":"e742e4bda77692da3eca698ef5bfac62d9fba06e","size":5750,"noattachment":false,"key":"/outvariant/-/outvariant-1.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/outvariant/download/outvariant-1.4.0.tgz"},"_npmUser":{"name":"kettanaito","email":"kettanaito@gmail.com"},"directories":{},"maintainers":[{"name":"kettanaito","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/outvariant_1.4.0_1679589964902_0.13176879386273632"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-03-23T16:46:05.093Z","publish_time":1679589965093,"_cnpm_publish_time":1679589965093},"1.3.0":{"name":"outvariant","version":"1.3.0","description":"Type-safe implementation of invariant with positionals.","main":"lib/index.js","typings":"lib/index.d.ts","author":{"name":"Artem Zakharchenko"},"license":"MIT","scripts":{"test":"jest","clean":"rimraf ./lib","build":"yarn clean && tsc","prepublishOnly":"yarn test && yarn build"},"keywords":["invariant","outvariant","exception","positional"],"devDependencies":{"@types/jest":"^26.0.23","jest":"^27.0.6","rimraf":"^3.0.2","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"repository":{"type":"git","url":"https://github.com/open-draft/outvariant"},"_id":"outvariant@1.3.0","dist":{"shasum":"c39723b1d2cba729c930b74bf962317a81b9b1c9","size":4257,"noattachment":false,"key":"/outvariant/-/outvariant-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/outvariant/download/outvariant-1.3.0.tgz"},"_npmUser":{"name":"kettanaito","email":"kettanaito@gmail.com"},"directories":{},"maintainers":[{"name":"kettanaito","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/outvariant_1.3.0_1647819292668_0.2511827312206727"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-03-20T23:34:55.998Z","publish_time":1647819292848,"_cnpm_publish_time":1647819292848},"1.2.1":{"name":"outvariant","version":"1.2.1","description":"Type-safe implementation of invariant with positionals.","main":"lib/index.js","typings":"lib/index.d.ts","author":{"name":"Artem Zakharchenko"},"license":"MIT","scripts":{"test":"jest","clean":"rimraf ./lib","build":"yarn clean && tsc","prepublishOnly":"yarn test && yarn build"},"keywords":["invariant","outvariant","exception","positional"],"devDependencies":{"@types/jest":"^26.0.23","jest":"^27.0.6","rimraf":"^3.0.2","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"repository":{"type":"git","url":"https://github.com/open-draft/outvariant"},"_id":"outvariant@1.2.1","dist":{"shasum":"e630f6cdc1dbf398ed857e36f219de4a005ccd35","size":3479,"noattachment":false,"key":"/outvariant/-/outvariant-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/outvariant/download/outvariant-1.2.1.tgz"},"_npmUser":{"name":"kettanaito","email":"kettanaito@gmail.com"},"directories":{},"maintainers":[{"name":"kettanaito","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/outvariant_1.2.1_1629889208629_0.48781742785411697"},"_hasShrinkwrap":false,"publish_time":1629889208759,"_cnpm_publish_time":1629889208759,"_cnpmcore_publish_time":"2021-12-16T20:36:20.512Z"},"1.2.0":{"name":"outvariant","version":"1.2.0","description":"Type-safe implementation of invariant with positionals.","main":"lib/index.js","typings":"lib/index.d.ts","author":{"name":"Artem Zakharchenko"},"license":"MIT","scripts":{"test":"jest","clean":"rimraf ./lib","build":"yarn clean && tsc","prepublishOnly":"yarn test && yarn build"},"keywords":["invariant","outvariant","exception","positional"],"devDependencies":{"@types/jest":"^26.0.23","jest":"^27.0.6","rimraf":"^3.0.2","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"repository":{"type":"git","url":"https://github.com/open-draft/outvariant"},"_id":"outvariant@1.2.0","dist":{"shasum":"c904d30dc36d70d93902b13641aa1fda69ae8c0c","size":2721,"noattachment":false,"key":"/outvariant/-/outvariant-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/outvariant/download/outvariant-1.2.0.tgz"},"_npmUser":{"name":"kettanaito","email":"kettanaito@gmail.com"},"directories":{},"maintainers":[{"name":"kettanaito","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/outvariant_1.2.0_1628089697115_0.03295952541227565"},"_hasShrinkwrap":false,"publish_time":1628089697271,"_cnpm_publish_time":1628089697271,"_cnpmcore_publish_time":"2021-12-16T20:36:20.716Z"},"1.1.0":{"name":"outvariant","version":"1.1.0","description":"Type-safe implementation of invariant with positionals.","main":"lib/index.js","typings":"lib/index.d.ts","author":{"name":"Artem Zakharchenko"},"license":"MIT","scripts":{"test":"jest","clean":"rimraf ./lib","build":"yarn clean && tsc","prepublishOnly":"yarn test && yarn build"},"keywords":["invariant","outvariant","exception","positional"],"devDependencies":{"@types/jest":"^26.0.23","jest":"^27.0.6","rimraf":"^3.0.2","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"repository":{"type":"git","url":"https://github.com/open-draft/outvariant"},"dependencies":{"@types/format-util":"^1.0.1","format-util":"^1.0.5"},"_id":"outvariant@1.1.0","dist":{"shasum":"3a28489cbbd4b55ba21cfec5c51c6703b57daea6","size":2188,"noattachment":false,"key":"/outvariant/-/outvariant-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/outvariant/download/outvariant-1.1.0.tgz"},"_npmUser":{"name":"kettanaito","email":"kettanaito@gmail.com"},"directories":{},"maintainers":[{"name":"kettanaito","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/outvariant_1.1.0_1627911631794_0.052432028708349954"},"_hasShrinkwrap":false,"publish_time":1627911631954,"_cnpm_publish_time":1627911631954,"_cnpmcore_publish_time":"2021-12-16T20:36:20.971Z"},"1.0.5":{"name":"outvariant","version":"1.0.5","description":"Type-safe implementation of invariant with positionals.","main":"lib/index.js","typings":"lib/index.d.ts","author":{"name":"Artem Zakharchenko"},"license":"MIT","scripts":{"test":"jest","clean":"rimraf ./lib","build":"yarn clean && tsc","prepublishOnly":"yarn test && yarn build"},"keywords":["invariant","outvariant","exception","positional"],"devDependencies":{"@types/jest":"^26.0.23","jest":"^27.0.6","rimraf":"^3.0.2","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"repository":{"type":"git","url":"https://github.com/open-draft/outvariant"},"_id":"outvariant@1.0.5","dist":{"shasum":"b1758e20dfb0ce8ad180e386766a7ee627fb4b4f","size":2237,"noattachment":false,"key":"/outvariant/-/outvariant-1.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/outvariant/download/outvariant-1.0.5.tgz"},"_npmUser":{"name":"kettanaito","email":"kettanaito@gmail.com"},"directories":{},"maintainers":[{"name":"kettanaito","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/outvariant_1.0.5_1627857238186_0.2419574620542595"},"_hasShrinkwrap":false,"publish_time":1627857238320,"_cnpm_publish_time":1627857238320,"_cnpmcore_publish_time":"2021-12-16T20:36:21.258Z"},"1.0.4":{"name":"outvariant","version":"1.0.4","description":"Type-safe implementation of invariant with positionals.","main":"lib/index.js","typings":"lib/index.d.ts","author":{"name":"Artem Zakharchenko"},"license":"MIT","scripts":{"test":"jest","clean":"rimraf ./lib","build":"yarn clean && tsc","prepublishOnly":"yarn test && yarn build"},"keywords":["invariant","outvariant","exception","positional"],"devDependencies":{"@types/jest":"^26.0.23","jest":"^27.0.6","rimraf":"^3.0.2","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"_id":"outvariant@1.0.4","dist":{"shasum":"d33d7fa70922e9488dfffd27d1451a8124c2bfec","size":2190,"noattachment":false,"key":"/outvariant/-/outvariant-1.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/outvariant/download/outvariant-1.0.4.tgz"},"_npmUser":{"name":"kettanaito","email":"kettanaito@gmail.com"},"directories":{},"maintainers":[{"name":"kettanaito","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/outvariant_1.0.4_1625223162064_0.816552274224202"},"_hasShrinkwrap":false,"publish_time":1625223162386,"_cnpm_publish_time":1625223162386,"_cnpmcore_publish_time":"2021-12-16T20:36:21.559Z"},"1.0.3":{"name":"outvariant","version":"1.0.3","description":"Type-safe implementation of invariant with positionals.","main":"lib/index.js","typings":"lib/index.d.ts","author":{"name":"Artem Zakharchenko"},"license":"MIT","scripts":{"test":"jest","clean":"rimraf ./lib","build":"yarn clean && tsc","prepublishOnly":"yarn test && yarn build"},"keywords":["invariant","outvariant","exception","positional"],"devDependencies":{"@types/jest":"^26.0.23","jest":"^27.0.6","rimraf":"^3.0.2","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"_id":"outvariant@1.0.3","dist":{"shasum":"7341c07b257b689db8bad46df9df897321ff219f","size":1967,"noattachment":false,"key":"/outvariant/-/outvariant-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/outvariant/download/outvariant-1.0.3.tgz"},"_npmUser":{"name":"kettanaito","email":"kettanaito@gmail.com"},"directories":{},"maintainers":[{"name":"kettanaito","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/outvariant_1.0.3_1625098217122_0.5849783681471479"},"_hasShrinkwrap":false,"publish_time":1625098217311,"_cnpm_publish_time":1625098217311,"_cnpmcore_publish_time":"2021-12-16T20:36:22.008Z"},"1.0.2":{"name":"outvariant","version":"1.0.2","description":"Yet another TypeScript implementation of invariant.","main":"lib/index.js","typings":"lib/index.d.ts","author":{"name":"Artem Zakharchenko"},"license":"MIT","scripts":{"test":"jest","clean":"rimraf ./lib","build":"yarn clean && tsc","prepublishOnly":"yarn test && yarn build"},"devDependencies":{"@types/jest":"^26.0.23","jest":"^27.0.6","rimraf":"^3.0.2","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"_id":"outvariant@1.0.2","dist":{"shasum":"5c16fd43f2632ee04db9bc1bac2ae879760de694","size":1593,"noattachment":false,"key":"/outvariant/-/outvariant-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/outvariant/download/outvariant-1.0.2.tgz"},"_npmUser":{"name":"kettanaito","email":"kettanaito@gmail.com"},"directories":{},"maintainers":[{"name":"kettanaito","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/outvariant_1.0.2_1625097848245_0.40037077201744986"},"_hasShrinkwrap":false,"publish_time":1625097848357,"_cnpm_publish_time":1625097848357,"_cnpmcore_publish_time":"2021-12-16T20:36:22.227Z"},"1.0.1":{"name":"outvariant","version":"1.0.1","description":"Yet another TypeScript implementation of invariant.","main":"lib/index.js","typings":"lib/index.d.ts","author":{"name":"Artem Zakharchenko"},"license":"MIT","scripts":{"test":"jest","clean":"rimraf ./lib","build":"yarn clean && tsc","prepublishOnly":"yarn test && yarn build"},"devDependencies":{"@types/jest":"^26.0.23","jest":"^27.0.6","rimraf":"^3.0.2","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"_id":"outvariant@1.0.1","dist":{"shasum":"9017864f5a827a45107ab6acd02525830fb5d80c","size":778,"noattachment":false,"key":"/outvariant/-/outvariant-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/outvariant/download/outvariant-1.0.1.tgz"},"_npmUser":{"name":"kettanaito","email":"kettanaito@gmail.com"},"directories":{},"maintainers":[{"name":"kettanaito","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/outvariant_1.0.1_1625097750459_0.024778343283255344"},"_hasShrinkwrap":false,"publish_time":1625097750622,"_cnpm_publish_time":1625097750622,"_cnpmcore_publish_time":"2021-12-16T20:36:22.441Z"},"1.0.0":{"name":"outvariant","version":"1.0.0","description":"Yet another TypeScript implementation of invariant.","main":"invariant.js","typings":"invariant.d.ts","author":{"name":"Artem Zakharchenko"},"license":"MIT","scripts":{"test":"jest","clean":"rimraf invariant.js invariant.d.ts","build":"yarn clean && tsc","prepublishOnly":"yarn test && yarn build"},"devDependencies":{"@types/jest":"^26.0.23","jest":"^27.0.6","rimraf":"^3.0.2","ts-jest":"^27.0.3","ts-node":"^10.0.0","typescript":"^4.3.4"},"_id":"outvariant@1.0.0","dist":{"shasum":"d6765b498e79084e7d8fc144f2f4bcfc00b8a9dd","size":1909,"noattachment":false,"key":"/outvariant/-/outvariant-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/outvariant/download/outvariant-1.0.0.tgz"},"_npmUser":{"name":"kettanaito","email":"kettanaito@gmail.com"},"directories":{},"maintainers":[{"name":"kettanaito","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/outvariant_1.0.0_1625096892956_0.8156408507642783"},"_hasShrinkwrap":false,"publish_time":1625096893097,"_cnpm_publish_time":1625096893097,"_cnpmcore_publish_time":"2021-12-16T20:36:22.637Z"}},"readme":"# `outvariant`\n\nType-safe implementation of invariant with positionals.\n\n## Motivation\n\n### Type-safely\n\nThis implementation asserts the given predicate expression so it's treated as non-nullable after the `invariant` call:\n\n```ts\n// Regular invariant:\ninvariant(user, 'Failed to fetch')\nuser?.firstName // \"user\" is possibly undefined\n\n// Outvariant:\ninvariant(user, 'Failed to fetch')\nuser.firstName // OK, \"invariant\" ensured the \"user\" exists\n```\n\n### Positionals support\n\nThis implementation uses [rest parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters) to support dynamic number of positionals:\n\n```js\ninvariant(predicate, 'Expected %s but got %s', 'one', false)\n```\n\n## What is this for?\n\nInvariant is a shorthand function that asserts a given predicate and throws an error if that predicate is false.\n\nCompare these two pieces of code identical in behavior:\n\n```js\nif (!token) {\n  throw new Error(`Expected a token to be set but got ${typeof token}`)\n}\n```\n\n```js\nimport { invariant } from 'outvariant'\n\ninvariant(token, 'Expected a token to be set but got %s', typeof token)\n```\n\nUsing `invariant` reduces the visual nesting of the code and leads to cleaner error messages thanks to formatted positionals (i.e. the `%s` (string) positional above).\n\n## Usage\n\n### Install\n\n```sh\nnpm install outvariant\n# or\nyarn add outvariant\n```\n\n> You may want to install this library as a dev dependency (`-D`) based on your usage.\n\n### Write an assertion\n\n```js\nimport { invariant } from 'outvariant'\n\ninvariant(user, 'Failed to load: expected user, but got %o', user)\n```\n\n## Positionals\n\nThe following positional tokens are supported:\n\n| Token     | Expected value type                                     |\n| --------- | ------------------------------------------------------- |\n| `%s`      | String                                                  |\n| `%d`/`%i` | Number                                                  |\n| `%j`      | JSON (non-stringified)                                  |\n| `%o`      | Arbitrary object or object-like (i.e. a class instance) |\n\nWhenever present in the error message, a positional token will look up the value to insert in its place from the arguments given to `invariant`.\n\n```js\ninvariant(\n  false,\n  'Expected the \"%s\" property but got %j',\n  // Note that positionals are sensitive to order:\n  // - \"firstName\" replaces \"%s\" because it's first.\n  // - {\"id\":1} replaces \"%j\" because it's second.\n  'firstName',\n  {\n    id: 1,\n  }\n)\n```\n\n## Polymorphic errors\n\nIt is possible to throw a custom `Error` instance using `invariant.as`:\n\n```js\nimport { invariant } from 'outvariant'\n\nclass NetworkError extends Error {\n  constructor(message) {\n    super(message)\n  }\n}\n\ninvariant.as(NetworkError, res.fulfilled, 'Failed to handle response')\n```\n\nNote that providing a custom error constructor as the argument to `invariant.as` requires the custom constructor's signature to be compatible with the `Error` class constructor.\n\nIf your error constructor has a different signature, you can pass a function as the first argument to `invariant.as` that creates a new custom error instance.\n\n```js\nimport { invariant } from 'outvariant'\n\nclass NetworkError extends Error {\n  constructor(statusCode, message) {\n    super(message)\n    this.statusCode = statusCode\n  }\n}\n\ninvariant.as(\n  (message) => new NetworkError(500, message),\n  res.fulfilled,\n  'Failed to handle response'\n)\n```\n\nAbstract the error into helper functions for flexibility:\n\n```js\nfunction toNetworkError(statusCode) {\n  return (message) => new NetworkError(statusCode, message)\n}\n\ninvariant.as(toNetworkError(404), res?.user?.id, 'User Not Found')\ninvariant.as(toNetworkError(500), res.fulfilled, 'Internal Server Error')\n```\n\n## Contributing\n\nPlease [open an issue](https://github.com/open-draft/outvariant/issues) or [submit a pull request](https://github.com/open-draft/outvariant/pulls) if you wish to contribute. Thank you.\n","_attachments":{},"license":"MIT"}