{"_id":"@consolidados/results","_rev":"11-c31e007058c2d7d4eb816fded84fe6a0","name":"@consolidados/results","dist-tags":{"latest":"0.5.0"},"versions":{"0.1.0":{"name":"@consolidados/results","version":"0.1.0","keywords":["Rust","Result","Option","Some","None","Ok","Err","Match"],"author":{"name":"Johnny Carreiro"},"license":"ISC","_id":"@consolidados/results@0.1.0","maintainers":[{"name":"consolidados","email":"contact@consolidados.digital"}],"homepage":"https://github.com/consolidados/results","bugs":{"url":"https://github.com/consolidados/results/issues"},"dist":{"shasum":"c45c07ab82bc56f99868cc5a4177ac9b17a65a2a","tarball":"https://registry.npmjs.org/@consolidados/results/-/results-0.1.0.tgz","fileCount":51,"integrity":"sha512-VgO54nHFNkhNEUR4J4tTg9JR9X7loOEKYvB2/RnPhLQo7lbkg2dMhFwDqqRRXA/k0aLiWpSGKqVVyD7HyW4lCA==","signatures":[{"sig":"MEUCIHYRHF6lSFMPSPAaAki8ej8np9ktEt7LqxiyZpsKSgdPAiEA6uS0hp1i6XrXeTsOA7h8m0ABYv3/Yc6NEnSjeZhygCA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":196559},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.cjs"},"./option":{"types":"./dist/option/index.d.ts","default":"./dist/option/index.js","require":"./dist/option/index.cjs"},"./result":{"types":"./dist/result/index.d.ts","default":"./dist/result/index.js","require":"./dist/result/index.cjs"},"./globals":{"types":"./dist/types/globals.d.ts"},"./helpers":{"types":"./dist/helpers/match.d.ts","default":"./dist/helpers/match.js","require":"./dist/helpers/match.cjs"}},"gitHead":"fddedbec91ef7dad987dd53de1c313cd485d9db2","scripts":{"test":"vitest run","build":"rm -rf dist && tsup","release":"release-it"},"_npmUser":{"name":"consolidados","email":"contact@consolidados.digital"},"repository":{"url":"git+https://github.com/consolidados/results.git","type":"git"},"_npmVersion":"10.8.2","description":"Result types, ease and simple","directories":{},"_nodeVersion":"20.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","vitest":"^3.0.9","release-it":"^18.1.2","typescript":"^5.8.2","@types/node":"^22.13.13"},"_npmOperationalInternal":{"tmp":"tmp/results_0.1.0_1743111951479_0.4302910915044815","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@consolidados/results","version":"0.1.1","keywords":["Rust","Result","Option","Some","None","Ok","Err","Match"],"author":{"name":"Johnny Carreiro"},"license":"ISC","_id":"@consolidados/results@0.1.1","maintainers":[{"name":"consolidados","email":"contact@consolidados.digital"}],"homepage":"https://github.com/consolidados/results","bugs":{"url":"https://github.com/consolidados/results/issues"},"dist":{"shasum":"295b40493da3ef2b1a2d67a93f50ec65f46f062f","tarball":"https://registry.npmjs.org/@consolidados/results/-/results-0.1.1.tgz","fileCount":6,"integrity":"sha512-5w7Qx+RZcvUpeKNDVjlmCPWkKDWlN+W0p31+hKOqv4AejN5lLDutAhJsLZX6jFPkfBDE6XKiyG3fCG73zp2Siw==","signatures":[{"sig":"MEUCIF+Eu5FlhsKCrSROhii4E+PN0+AvQ/xCWgB8UpKNDrEuAiEArv1oWjAADQ2lkvPPIZeiQeKNP6ETc3ccBIBPWXDanu8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16916},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.cjs"},"./option":{"types":"./dist/option/index.d.ts","default":"./dist/option/index.js","require":"./dist/option/index.cjs"},"./result":{"types":"./dist/result/index.d.ts","default":"./dist/result/index.js","require":"./dist/result/index.cjs"},"./globals":{"types":"./dist/types/globals.d.ts"},"./helpers":{"types":"./dist/helpers/match.d.ts","default":"./dist/helpers/match.js","require":"./dist/helpers/match.cjs"}},"gitHead":"3579c70a36ceedec7d94edad6e21d91fab2282d5","scripts":{"test":"vitest run","build":"rm -rf dist && tsup","release":"release-it","format-and-lint":"biome check .","format-and-lint:fix":"biome check . --write"},"_npmUser":{"name":"consolidados","email":"contact@consolidados.digital"},"repository":{"url":"git+https://github.com/consolidados/results.git","type":"git"},"_npmVersion":"10.8.2","description":"Result types, ease and simple","directories":{},"_nodeVersion":"20.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","biome":"^0.3.3","vitest":"^3.0.9","release-it":"^18.1.2","typescript":"^5.8.2","@types/node":"^22.13.13","@release-it/conventional-changelog":"^10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/results_0.1.1_1743362972571_0.9967332588076059","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@consolidados/results","version":"0.1.2","keywords":["Rust","Result","Option","Some","None","Ok","Err","Match"],"author":{"name":"Johnny Carreiro"},"license":"ISC","_id":"@consolidados/results@0.1.2","maintainers":[{"name":"consolidados","email":"contact@consolidados.digital"}],"homepage":"https://github.com/consolidados/results","bugs":{"url":"https://github.com/consolidados/results/issues"},"dist":{"shasum":"98c5d346d4d1e8fcbddd29dc09e29c543c7a6e69","tarball":"https://registry.npmjs.org/@consolidados/results/-/results-0.1.2.tgz","fileCount":2,"integrity":"sha512-CJ1nGb8S5PoN1q8SsNqGCEsVohOgv6WDZt0+cGc5SfQnECHs5cqOn9VhQhfMWIQsbid8ZeOdepG+zfA3Gr60nw==","signatures":[{"sig":"MEYCIQD+vttASsdwO6nK2EyIBu+tJRZCpk9OKt1Bp2pq2Qk5OwIhAODWkri54al8qZoilfed4E/3acBCcaf2l+dxh1V3nqf8","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14319},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.cjs"},"./option":{"types":"./dist/option/index.d.ts","default":"./dist/option/index.js","require":"./dist/option/index.cjs"},"./result":{"types":"./dist/result/index.d.ts","default":"./dist/result/index.js","require":"./dist/result/index.cjs"},"./globals":{"types":"./dist/types/globals.d.ts"},"./helpers":{"types":"./dist/helpers/match.d.ts","default":"./dist/helpers/match.js","require":"./dist/helpers/match.cjs"}},"gitHead":"f728a87aa0be1f51d9b7fb75ded9d7e5cf751e51","scripts":{"test":"vitest run","build":"rm -rf dist && tsup","release":"release-it","format-and-lint":"biome check .","format-and-lint:fix":"biome check . --write"},"_npmUser":{"name":"consolidados","email":"contact@consolidados.digital"},"repository":{"url":"git+https://github.com/consolidados/results.git","type":"git"},"_npmVersion":"10.8.2","description":"Result types, ease and simple","directories":{},"_nodeVersion":"20.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","biome":"^0.3.3","vitest":"^3.0.9","release-it":"^18.1.2","typescript":"^5.8.2","@types/node":"^22.13.13","@release-it/conventional-changelog":"^10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/results_0.1.2_1743635743533_0.46896174130835777","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@consolidados/results","version":"0.1.3","keywords":["Rust","Result","Option","Some","None","Ok","Err","Match"],"author":{"name":"Johnny Carreiro"},"license":"ISC","_id":"@consolidados/results@0.1.3","maintainers":[{"name":"consolidados","email":"contact@consolidados.digital"}],"homepage":"https://github.com/consolidados/results","bugs":{"url":"https://github.com/consolidados/results/issues"},"dist":{"shasum":"86f32d000b1b73ba7915d0c9997d20d7d57a7251","tarball":"https://registry.npmjs.org/@consolidados/results/-/results-0.1.3.tgz","fileCount":48,"integrity":"sha512-dNIUBL0CGBzGQoM2+0XZtSrrPOVaiTIPc5DyazQD+8Tui+h6TxwS3gSOXKQJHQ7Ru3bi8yd7cfY0eHJkpXo+uA==","signatures":[{"sig":"MEUCIF8MbPrBjWWShOB9J2aIGK1fHfR9rwcIMA7e35pr2nxvAiEA33PfHaQ3Lh1Z1brcyH9QeuNm8DEXK4u84qWxe9PMwSs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":196454},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.cjs"},"./option":{"types":"./dist/option/index.d.ts","default":"./dist/option/index.js","require":"./dist/option/index.cjs"},"./result":{"types":"./dist/result/index.d.ts","default":"./dist/result/index.js","require":"./dist/result/index.cjs"},"./globals":{"types":"./dist/types/globals.d.ts"},"./helpers":{"types":"./dist/helpers/match.d.ts","default":"./dist/helpers/match.js","require":"./dist/helpers/match.cjs"}},"gitHead":"23b3ee9ad6d26c29173da169ef8dba415f3bc29e","scripts":{"test":"vitest run","build":"rm -rf dist && tsup","release":"release-it","format-and-lint":"biome check .","format-and-lint:fix":"biome check . --write"},"_npmUser":{"name":"consolidados","email":"contact@consolidados.digital"},"repository":{"url":"git+https://github.com/consolidados/results.git","type":"git"},"_npmVersion":"10.8.2","description":"Result types, ease and simple","directories":{},"_nodeVersion":"20.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","biome":"^0.3.3","vitest":"^3.0.9","release-it":"^18.1.2","typescript":"^5.8.2","@types/node":"^22.13.13","@release-it/conventional-changelog":"^10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/results_0.1.3_1743636811847_0.8393933976778316","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@consolidados/results","version":"0.1.4","keywords":["Rust","Result","Option","Some","None","Ok","Err","Match"],"author":{"name":"Johnny Carreiro"},"license":"ISC","_id":"@consolidados/results@0.1.4","maintainers":[{"name":"consolidados","email":"contact@consolidados.digital"}],"homepage":"https://github.com/consolidados/results","bugs":{"url":"https://github.com/consolidados/results/issues"},"dist":{"shasum":"b06a8047d931a731e3775b3dda57e5794f527baf","tarball":"https://registry.npmjs.org/@consolidados/results/-/results-0.1.4.tgz","fileCount":46,"integrity":"sha512-WqgwvUTPWEz+/1Y4Pzg2nJeU30ieYCq26+CN8yCu4N3r1c6eoJxpQw/5ALKo7l4R1E37gN7Vl2ew+G3Pf4f59A==","signatures":[{"sig":"MEUCIBhJSS5g7kqsGrffraHJc6UedZJtXhIGd58OK6FbZmxpAiEAqIVKVu1uROe47ChWNlGXSluckqLwmrEojXn/xTar9sU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":204074},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.cjs"},"./option":{"types":"./dist/option/index.d.ts","default":"./dist/option/index.js","require":"./dist/option/index.cjs"},"./result":{"types":"./dist/result/index.d.ts","default":"./dist/result/index.js","require":"./dist/result/index.cjs"},"./globals":{"types":"./dist/types/globals.d.ts"},"./helpers":{"types":"./dist/helpers/match.d.ts","default":"./dist/helpers/match.js","require":"./dist/helpers/match.cjs"}},"gitHead":"9533c3020d0381c9c89639533df23f7ee526e136","scripts":{"test":"vitest run","build":"rm -rf dist && tsup","release":"release-it","format-and-lint":"biome check .","format-and-lint:fix":"biome check . --write"},"_npmUser":{"name":"consolidados","email":"contact@consolidados.digital"},"repository":{"url":"git+https://github.com/consolidados/results.git","type":"git"},"_npmVersion":"10.8.2","description":"Result types, ease and simple","directories":{},"_nodeVersion":"20.19.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","biome":"^0.3.3","vitest":"^3.0.9","release-it":"^18.1.2","typescript":"^5.8.2","@types/node":"^22.13.13","@release-it/conventional-changelog":"^10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/results_0.1.4_1746653092413_0.8542747395433143","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@consolidados/results","version":"0.1.5","keywords":["Rust","Result","Option","Some","None","Ok","Err","Match"],"author":{"name":"Johnny Carreiro"},"license":"ISC","_id":"@consolidados/results@0.1.5","maintainers":[{"name":"consolidados","email":"contact@consolidados.digital"}],"homepage":"https://github.com/consolidados/results","bugs":{"url":"https://github.com/consolidados/results/issues"},"dist":{"shasum":"749dabeda505fbda37be7ed57a2f610d6d1dd36c","tarball":"https://registry.npmjs.org/@consolidados/results/-/results-0.1.5.tgz","fileCount":46,"integrity":"sha512-y+eomF6GNfzWVT4PIAWLD+9kmTu7suD47SYB4QbjpVCOHIRagEhioAxxaV29ZC2DbOaZibWIduKLNw8aturEuw==","signatures":[{"sig":"MEQCIEu+JqLnkeXtCDSXUeYpiOVk889/D3BaZlg3a5HJ2m5wAiBvhcPLfJ5FxIKweow0C0b9r7R3lItTUgEeo0nB+LqvZQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":204464},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.cjs"},"./option":{"types":"./dist/option/index.d.ts","default":"./dist/option/index.js","require":"./dist/option/index.cjs"},"./result":{"types":"./dist/result/index.d.ts","default":"./dist/result/index.js","require":"./dist/result/index.cjs"},"./globals":{"types":"./dist/types/globals.d.ts"},"./helpers":{"types":"./dist/helpers/match.d.ts","default":"./dist/helpers/match.js","require":"./dist/helpers/match.cjs"}},"gitHead":"3a2fbf472371c0387cbd8da5b3d94d47e259f06f","scripts":{"test":"vitest run","build":"rm -rf dist && tsup","release":"release-it","format-and-lint":"biome check .","format-and-lint:fix":"biome check . --write"},"_npmUser":{"name":"consolidados","email":"contact@consolidados.digital"},"repository":{"url":"git+https://github.com/consolidados/results.git","type":"git"},"_npmVersion":"10.8.2","description":"Result types, ease and simple","directories":{},"sideEffects":true,"_nodeVersion":"20.19.4","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","biome":"^0.3.3","vitest":"^3.0.9","release-it":"^18.1.2","typescript":"^5.8.2","@types/node":"^22.13.13","@release-it/conventional-changelog":"^10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/results_0.1.5_1754274427536_0.1568000195831083","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@consolidados/results","version":"0.2.0","keywords":["Rust","Result","Option","Some","None","Ok","Err","Match"],"author":{"name":"Johnny Carreiro"},"license":"ISC","_id":"@consolidados/results@0.2.0","maintainers":[{"name":"consolidados","email":"contact@consolidados.digital"}],"homepage":"https://github.com/consolidados/results","bugs":{"url":"https://github.com/ConsoliDados/results/issues"},"dist":{"shasum":"049d9b7d3db9354e521a2de8959d94e2666821f7","tarball":"https://registry.npmjs.org/@consolidados/results/-/results-0.2.0.tgz","fileCount":46,"integrity":"sha512-aOG5S0wOaO6JEz5TE1yCrsC1s7Wc8bWLd57hc1cejGeMS+KE2jqZ6bycFjumElKnPKQMfSmujpxymr9+sP+XoA==","signatures":[{"sig":"MEUCIARMfgJUqeIWYTVRhmyQ4jTv3mqQXd29xYtZYrV2IqZ9AiEA0C1F/aoXpefMGpjpRxPmU4S1at7sg9DsqG5tdRBN9Io=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@consolidados%2fresults@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":391629},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.cjs"},"./option":{"types":"./dist/option/index.d.ts","default":"./dist/option/index.js","require":"./dist/option/index.cjs"},"./result":{"types":"./dist/result/index.d.ts","default":"./dist/result/index.js","require":"./dist/result/index.cjs"},"./globals":{"types":"./dist/types/globals.d.ts"},"./helpers":{"types":"./dist/helpers/match.d.ts","default":"./dist/helpers/match.js","require":"./dist/helpers/match.cjs"}},"gitHead":"d28b70c4f91193c77d2d6d6a20f666f2ca095313","scripts":{"test":"vitest run","build":"rm -rf dist && tsup","format-and-lint":"biome check .","format-and-lint:fix":"biome check . --write"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e6e436e2-a2c6-4ae7-b126-2b9a5e1bd42c"}},"repository":{"url":"git+https://github.com/ConsoliDados/results.git","type":"git"},"_npmVersion":"11.9.0","description":"Result types, ease and simple","directories":{},"sideEffects":true,"_nodeVersion":"24.13.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","biome":"^0.3.3","vitest":"^3.0.9","release-it":"^18.1.2","typescript":"^5.9.3","@types/node":"^22.13.13","@release-it/conventional-changelog":"^10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/results_0.2.0_1770515688220_0.3270417442312472","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@consolidados/results","version":"0.2.1","keywords":["Rust","Result","Option","Some","None","Ok","Err","Match"],"author":{"name":"Johnny Carreiro"},"license":"ISC","_id":"@consolidados/results@0.2.1","maintainers":[{"name":"consolidados","email":"contact@consolidados.digital"}],"homepage":"https://github.com/consolidados/results","bugs":{"url":"https://github.com/ConsoliDados/results/issues"},"dist":{"shasum":"c787bfd72791e421dddb343803bd309d49f7b48a","tarball":"https://registry.npmjs.org/@consolidados/results/-/results-0.2.1.tgz","fileCount":46,"integrity":"sha512-ww02rzDY/X9P9lwhO+NVfR1W76EfkD0i/r4u2iSlihNKr3wXhNZo3xg51Dw4Byah7PhNxwT+vBQwFr4XxPzRGA==","signatures":[{"sig":"MEUCIH5NJ0XTAgLXL0b1r/HGuinhNIHVZu/l5UgNs3BCa1AQAiEA4LyNnwgp7HdgVDV1id0RPzOHDEuKBZjDvqbw63la9b8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@consolidados%2fresults@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":391629},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.cjs"},"./option":{"types":"./dist/option/index.d.ts","default":"./dist/option/index.js","require":"./dist/option/index.cjs"},"./result":{"types":"./dist/result/index.d.ts","default":"./dist/result/index.js","require":"./dist/result/index.cjs"},"./globals":{"types":"./dist/types/globals.d.ts"},"./helpers":{"types":"./dist/helpers/match.d.ts","default":"./dist/helpers/match.js","require":"./dist/helpers/match.cjs"}},"gitHead":"e3b055b21aac767623b338c812c1b0713b933c9e","scripts":{"test":"vitest run","build":"rm -rf dist && tsup","format-and-lint":"biome check .","format-and-lint:fix":"biome check . --write"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e6e436e2-a2c6-4ae7-b126-2b9a5e1bd42c"}},"repository":{"url":"git+https://github.com/ConsoliDados/results.git","type":"git"},"_npmVersion":"11.9.0","description":"Result types, ease and simple","directories":{},"sideEffects":true,"_nodeVersion":"24.13.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","biome":"^0.3.3","vitest":"^3.0.9","release-it":"^18.1.2","typescript":"^5.9.3","@types/node":"^22.13.13","@release-it/conventional-changelog":"^10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/results_0.2.1_1770516131637_0.19504111227239274","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@consolidados/results","version":"0.3.0","keywords":["Rust","Result","Option","Some","None","Ok","Err","Match"],"author":{"name":"Johnny Carreiro"},"license":"ISC","_id":"@consolidados/results@0.3.0","maintainers":[{"name":"consolidados","email":"contact@consolidados.digital"}],"homepage":"https://github.com/consolidados/results","bugs":{"url":"https://github.com/ConsoliDados/results/issues"},"dist":{"shasum":"83d9686753b03e2cd3071b44b5aa099cede89df0","tarball":"https://registry.npmjs.org/@consolidados/results/-/results-0.3.0.tgz","fileCount":46,"integrity":"sha512-aq+GciITl7WXqDCWZqPyxWszIoLyqOcuyKDS0Tdq7lT+cFuNiyc6m/SxIHbGiKWkPQLUhmKHRn5gc3Dtll3qIg==","signatures":[{"sig":"MEUCIAnFoIuJRvkCeh52fu5+SP9PJn6e+f+90v6hwUcakoAmAiEAuWzXMSLJN1kM+Ze6/uJdeH3+nDMuN/CfwAbHRWJCvvc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@consolidados%2fresults@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":406713},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.cjs"},"./option":{"types":"./dist/option/index.d.ts","default":"./dist/option/index.js","require":"./dist/option/index.cjs"},"./result":{"types":"./dist/result/index.d.ts","default":"./dist/result/index.js","require":"./dist/result/index.cjs"},"./globals":{"types":"./dist/types/globals.d.ts"},"./helpers":{"types":"./dist/helpers/match.d.ts","default":"./dist/helpers/match.js","require":"./dist/helpers/match.cjs"}},"gitHead":"48880c597cc16c811518970458e51c8112f3cf3a","scripts":{"test":"vitest run","build":"rm -rf dist && tsup","format-and-lint":"biome check .","format-and-lint:fix":"biome check . --write"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e6e436e2-a2c6-4ae7-b126-2b9a5e1bd42c"}},"repository":{"url":"git+https://github.com/ConsoliDados/results.git","type":"git"},"_npmVersion":"11.10.0","description":"Result types, ease and simple","directories":{},"sideEffects":true,"_nodeVersion":"24.13.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","biome":"^0.3.3","vitest":"^3.0.9","release-it":"^18.1.2","typescript":"^5.9.3","@types/node":"^22.13.13","@release-it/conventional-changelog":"^10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/results_0.3.0_1770931011353_0.31549043427900036","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@consolidados/results","version":"0.4.0","keywords":["Rust","Result","Option","Some","None","Ok","Err","Match"],"author":{"name":"Johnny Carreiro"},"license":"ISC","_id":"@consolidados/results@0.4.0","maintainers":[{"name":"consolidados","email":"contact@consolidados.digital"}],"homepage":"https://github.com/consolidados/results","bugs":{"url":"https://github.com/ConsoliDados/results/issues"},"dist":{"shasum":"fdaef8256e48db2cb87031eb7f6d647a5d20d078","tarball":"https://registry.npmjs.org/@consolidados/results/-/results-0.4.0.tgz","fileCount":46,"integrity":"sha512-h8s9bEeElG5aqjj8ggcBPpRsQyFyUyfkviqjsX/FsCgJIXFTfG0hn/4gKYE7pS5nYuhKCHr5JkCIZw7yWvIUjQ==","signatures":[{"sig":"MEYCIQDXWrMdSNzwP4WWndOF+HIYsFl9F9fOSEfhP3A8fQja4wIhAL1x41+eBNN51NMA0RDAy+n9wxlJ/JLf9GfXF1gfBkdH","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@consolidados%2fresults@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":405964},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js","require":"./dist/index.cjs"},"./option":{"types":"./dist/option/index.d.ts","default":"./dist/option/index.js","require":"./dist/option/index.cjs"},"./result":{"types":"./dist/result/index.d.ts","default":"./dist/result/index.js","require":"./dist/result/index.cjs"},"./globals":{"types":"./dist/types/globals.d.ts"},"./helpers":{"types":"./dist/helpers/match.d.ts","default":"./dist/helpers/match.js","require":"./dist/helpers/match.cjs"}},"gitHead":"66abd8264c3638f53984886606603f1351a4a327","scripts":{"test":"vitest run","build":"rm -rf dist && tsup","format-and-lint":"biome check .","format-and-lint:fix":"biome check . --write"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e6e436e2-a2c6-4ae7-b126-2b9a5e1bd42c"}},"repository":{"url":"git+https://github.com/ConsoliDados/results.git","type":"git"},"_npmVersion":"11.11.0","description":"Result types, ease and simple","directories":{},"sideEffects":true,"_nodeVersion":"24.13.1","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","vitest":"^3.0.9","typescript":"^5.9.3","@types/node":"^22.13.13","@biomejs/biome":"^2.3.15"},"_npmOperationalInternal":{"tmp":"tmp/results_0.4.0_1772645612470_0.2530610932558459","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@consolidados/results","version":"0.5.0","description":"Result types, ease and simple","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","type":"module","sideEffects":true,"homepage":"https://github.com/consolidados/results","repository":{"type":"git","url":"git+https://github.com/ConsoliDados/results.git"},"exports":{"./option":{"types":"./dist/option/index.d.ts","require":"./dist/option/index.cjs","default":"./dist/option/index.js"},"./result":{"types":"./dist/result/index.d.ts","require":"./dist/result/index.cjs","default":"./dist/result/index.js"},"./helpers":{"types":"./dist/helpers/match.d.ts","require":"./dist/helpers/match.cjs","default":"./dist/helpers/match.js"},"./globals":{"types":"./dist/types/globals.d.ts"},".":{"types":"./dist/index.d.ts","require":"./dist/index.cjs","default":"./dist/index.js"}},"scripts":{"build":"rm -rf dist && tsup","test":"vitest run","bench":"vitest bench --run","format-and-lint":"biome check .","format-and-lint:fix":"biome check . --write"},"keywords":["Rust","Result","Option","Some","None","Ok","Err","Match"],"author":{"name":"Johnny Carreiro"},"license":"ISC","devDependencies":{"@biomejs/biome":"^2.3.15","@types/node":"^22.13.13","tsup":"^8.4.0","typescript":"^5.9.3","vitest":"^3.0.9"},"publishConfig":{"access":"public","provenance":true},"gitHead":"490852a1172c7508650a01f12617189a7d813564","_id":"@consolidados/results@0.5.0","bugs":{"url":"https://github.com/ConsoliDados/results/issues"},"_nodeVersion":"24.16.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-yNRRDi8NwwqafTE5RjEmMG9E6XhtVMuV2b3YeyWonIgYinDyfjmIp4x5rurydvh3q5jFJ0ERfyIJFNSKv0L2uw==","shasum":"8f99ab2de34ae472e54ff322295c8ba7bbc4bb99","tarball":"https://registry.npmjs.org/@consolidados/results/-/results-0.5.0.tgz","fileCount":46,"unpackedSize":420591,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@consolidados%2fresults@0.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDGAfVpac7qZVPG/4lY0DbZTLITXgtk+ny5OQwQg87+eAiBHxrnjUAz4vHHPPaPdLKQpXPx40Enj6euNlGG8Nb9KqA=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e6e436e2-a2c6-4ae7-b126-2b9a5e1bd42c"}},"directories":{},"maintainers":[{"name":"consolidados","email":"contact@consolidados.digital"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/results_0.5.0_1780008902869_0.4118341833054808"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-27T21:45:51.347Z","modified":"2026-05-28T22:55:03.283Z","0.1.0":"2025-03-27T21:45:51.678Z","0.1.1":"2025-03-30T19:29:32.754Z","0.1.2":"2025-04-02T23:15:43.758Z","0.1.3":"2025-04-02T23:33:32.052Z","0.1.4":"2025-05-07T21:24:52.595Z","0.1.5":"2025-08-04T02:27:07.757Z","0.2.0":"2026-02-08T01:54:48.357Z","0.2.1":"2026-02-08T02:02:11.804Z","0.3.0":"2026-02-12T21:16:51.477Z","0.4.0":"2026-03-04T17:33:32.619Z","0.5.0":"2026-05-28T22:55:03.023Z"},"bugs":{"url":"https://github.com/ConsoliDados/results/issues"},"author":{"name":"Johnny Carreiro"},"license":"ISC","homepage":"https://github.com/consolidados/results","keywords":["Rust","Result","Option","Some","None","Ok","Err","Match"],"repository":{"type":"git","url":"git+https://github.com/ConsoliDados/results.git"},"description":"Result types, ease and simple","maintainers":[{"name":"consolidados","email":"contact@consolidados.digital"}],"readme":"# ResulTS\n\n[![npm version](https://badge.fury.io/js/%40consolidados%2Fresults.svg)](https://www.npmjs.com/package/@consolidados/results)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nThis package provides robust implementations of the `Result` and `Option` types, inspired by Rust's functional programming principles, to handle success/failure scenarios and optional values in your TypeScript applications.\n\n## Features\n\n- 🦀 **Rust-inspired** - Battle-tested patterns from Rust's type system\n- 🎯 **Type-safe** - Full TypeScript support with type narrowing\n- 🚀 **Performance** - None singleton pattern (95% less allocations)\n- 🔄 **Flexible** - Support for any error type (enums, strings, custom classes)\n- 🎨 **Pattern matching** - Match primitives, enums, discriminated unions, and mixed primitive + object unions\n- 🛠️ **Rich API** - unwrapOr, orElse, filter, and more\n- 🌍 **Global availability** - Optional global imports for cleaner code\n\n## Installation\n\n```bash\nnpm install @consolidados/results\n```\n\n### Global Availability (Recommended)\n\nFor cleaner code, make `Ok`, `Err`, `Some`, `None`, and `match` globally available:\n\n1. **Configure `tsconfig.json`:**\n\n```json\n{\n  \"compilerOptions\": {\n    \"types\": [\"@consolidados/results/globals\"]\n  }\n}\n```\n\n2. **Import in entry point (e.g., `main.ts`):**\n\n```typescript\nimport \"@consolidados/results\";\n```\n\nNow use them anywhere without imports:\n\n```typescript\nconst result = Ok(42);\nconst option = Some(\"hello\");\n```\n\n### Monorepo / workspace setup\n\nIn a monorepo (Turborepo, Nx, pnpm workspaces, etc.) you usually don't want\nto repeat the global wiring in every `tsconfig.json` and every entrypoint.\nWrap it once in a shared types package and have the other workspaces depend\non that.\n\n**1. Create a shared package, e.g. `packages/types`:**\n\n`packages/types/src/globals.ts` — runtime side-effect (registers\n`Ok`, `Err`, `Some`, `None`, `match` on `globalThis`):\n\n```typescript\nimport \"@consolidados/results\";\n```\n\n`packages/types/src/globals-types.d.ts` — ambient TypeScript types so\n`Result<T, E>` and `Option<T>` work without per-file imports:\n\n```typescript\nimport type { Option as _Option, Result as _Result } from \"@consolidados/results\";\n\ndeclare global {\n  type Result<T, E> = _Result<T, E>;\n  type Option<T> = _Option<T>;\n}\n\nexport {};\n```\n\n`packages/types/package.json` — expose both as subpath exports:\n\n```json\n{\n  \"name\": \"@your-org/types\",\n  \"dependencies\": { \"@consolidados/results\": \"^0.5.0\" },\n  \"exports\": {\n    \"./globals\": \"./src/globals.ts\",\n    \"./globals-types\": \"./src/globals-types.d.ts\"\n  }\n}\n```\n\n**2. In each consuming workspace:**\n\n`services/<name>/tsconfig.json`:\n\n```json\n{\n  \"compilerOptions\": {\n    \"types\": [\"node\", \"@your-org/types/globals-types\"]\n  }\n}\n```\n\n`services/<name>/src/main.ts` (first import of the entrypoint):\n\n```typescript\nimport \"@your-org/types/globals\";\n```\n\nNow every file in that workspace can use `Ok`, `Err`, `Some`, `None`, `match`,\n`Result<T, E>`, and `Option<T>` without any import — and the wiring lives in\none place.\n\n## Quick Start\n\n### Result - Handle Success/Failure\n\n```typescript\n// import { Result, Ok, Err } from \"@consolidados/results\"; // If not global must import Ok and Err\nimport { Result } from \"@consolidados/results\";\n\nfunction divide(a: number, b: number): Result<number, string> {\n  if (b === 0) {\n    return Err(\"Cannot divide by zero\");\n  }\n  return Ok(a / b);\n}\n\nconst result = divide(10, 2);\n\nif (result.isOk()) {\n  console.log(\"Result:\", result.value()); // 5\n} else {\n  console.error(\"Error:\", result.value());\n}\n```\n\n### Option - Handle Optional Values\n\n```typescript\n// import { Option, Some, None } from \"@consolidados/results\"; // If not global must  import Some and None\nimport { Option } from \"@consolidados/results\";\n\nfunction findUser(id: number): Option<string> {\n  return id === 123 ? Some(\"John Doe\") : None();\n}\n\nconst user = findUser(123);\n\nif (user.isSome()) {\n  console.log(\"User:\", user.value()); // \"John Doe\"\n}\n```\n\n## Core Concepts\n\n### `Result<T, E>`\n\nRepresents an operation that can succeed with value `T` or fail with error `E`.\n\n**Key difference from Rust:** `E` can be **any type** - not just Error!\n\n```typescript\n// String errors\nResult<User, string>\n\n// Const object errors (recommended)\nconst APIError = { NotFound: \"NOT_FOUND\", ... } as const\nResult<Data, typeof APIError[keyof typeof APIError]>\n\n// Enum errors (works but has overhead)\nenum APIError { NotFound, Unauthorized }\nResult<Data, APIError>\n\n// Custom class errors\nclass ValidationError { field: string; message: string }\nResult<Form, ValidationError>\n\n// Traditional Error\nResult<number, Error>\n```\n\n### Enum vs Const Object (Important!)\n\nTypeScript enums have runtime overhead. We recommend **const objects** instead:\n\n#### ❌ TypeScript Enum (not recommended)\n\n```typescript\nenum APIError {\n  NotFound = \"NOT_FOUND\",\n  Unauthorized = \"UNAUTHORIZED\",\n}\n```\n\n**Compiles to JavaScript:**\n```javascript\nvar APIError;\n(function (APIError) {\n    APIError[\"NotFound\"] = \"NOT_FOUND\";\n    APIError[\"Unauthorized\"] = \"UNAUTHORIZED\";\n})(APIError || (APIError = {}));\n```\n\n**Problems:**\n- 🐛 Generates extra JavaScript code (IIFE)\n- 📦 Increases bundle size\n- 🔄 Creates object at runtime (overhead)\n- ❌ Not tree-shakeable\n\n#### ✅ Const Object (recommended)\n\n```typescript\nconst APIError = {\n  NotFound: \"NOT_FOUND\",\n  Unauthorized: \"UNAUTHORIZED\",\n  ServerError: \"SERVER_ERROR\",\n} as const;\n  \ntype APIError = (typeof APIError)[keyof typeof APIError];\n\n// Usage (same as enum!)\nconst result: Result<User, APIError> = Err(APIError.NotFound);\n```\n\n**Compiles to JavaScript:**\n```javascript\nconst APIError = {\n    NotFound: \"NOT_FOUND\",\n    Unauthorized: \"UNAUTHORIZED\",\n};\n```\n\n**Benefits:**\n- ✅ Zero runtime overhead (simple object literal)\n- ✅ Tree-shakeable\n- ✅ Same ergonomics as enum: `APIError.NotFound`\n- ✅ Full type safety\n\n#### Alternative: String Literal Unions\n\n```typescript\ntype APIError = \"NOT_FOUND\" | \"UNAUTHORIZED\" | \"SERVER_ERROR\";\n\n// Usage (no namespace, just strings)\nconst result: Result<User, APIError> = Err(\"NOT_FOUND\");\n```\n\n**Benefits:**\n- ✅ Zero JavaScript generated (TypeScript-only)\n- ✅ Simpler\n- ❌ No namespace (must use raw strings)\n\n#### Creating Results\n\n```typescript\n// Success\nconst success = Ok(42);\nconst user = Ok({ id: 1, name: \"John\" });\n\n// Failure with different error types\nconst stringErr = Err(\"Something went wrong\");\nconst enumErr = Err(APIError.NotFound);\nconst classErr = Err(new ValidationError(\"email\", \"Invalid format\"));\nconst errorErr = Err(new Error(\"System error\"));\n```\n\n#### Type Narrowing with `value()`\n\n```typescript\nconst result: Result<number, string> = divide(10, 2);\n\n// Without type guard - must handle both cases\nconst value = result.value(); // Type: number | string\n\n// With type guard - TypeScript narrows the type\nif (result.isOk()) {\n  const num = result.value(); // Type: number ✅\n  console.log(num * 2);\n}\n\nif (result.isErr()) {\n  const err = result.value(); // Type: string ✅\n  console.error(err);\n}\n```\n\n#### Result Methods\n\n**Checking state:**\n- `isOk()` - Returns true if Ok\n- `isErr()` - Returns true if Err\n\n**Extracting values:**\n- `unwrap()` - Get value or throw\n- `unwrapErr()` - Get error or throw\n- `value()` - Get value/error with type narrowing\n- `unwrapOr(default)` - Get value or default\n- `unwrapOrElse(fn)` - Get value or compute default\n\n**Transforming:**\n- `map(fn)` - Transform Ok value\n- `flatMap(fn)` - Chain Result-returning operations\n- `mapErr(fn)` - Transform Err value\n- `orElse(fn)` - Recover from errors\n\n**Converting:**\n- `ok()` - Convert to Option<T>\n\n#### Examples\n\n```typescript\n// unwrapOr - provide default value\nconst result = divide(10, 0);\nconst value = result.unwrapOr(0); // Returns 0 on error\n\n// unwrapOrElse - compute default value\nconst value = result.unwrapOrElse((err) => {\n  console.error(\"Division failed:\", err);\n  return 0;\n});\n\n// orElse - recover from errors\nconst recovered = result.orElse((err) => {\n  return Ok(0); // Provide fallback Result\n});\n\n// Chaining operations\nconst final = Ok(10)\n  .map(x => x * 2)        // Ok(20)\n  .flatMap(x => divide(x, 4)) // Ok(5)\n  .map(x => x + 1);       // Ok(6)\n```\n\n### `Option<T>`\n\nRepresents an optional value that may or may not exist.\n\n#### Creating Options\n\n```typescript\nconst some = Some(42);\nconst none = None(); // Singleton - same instance reused\n```\n\n#### Type Narrowing with `value()`\n\n```typescript\nconst option: Option<string> = Some(\"hello\");\n\n// Without type guard\nconst value = option.value(); // Type: string | undefined\n\n// With type guard\nif (option.isSome()) {\n  const str = option.value(); // Type: string ✅\n  console.log(str.toUpperCase());\n}\n\nif (option.isNone()) {\n  const val = option.value(); // Type: undefined ✅\n}\n```\n\n#### Option Methods\n\n**Checking state:**\n- `isSome()` - Returns true if Some\n- `isNone()` - Returns true if None\n\n**Extracting values:**\n- `unwrap()` - Get value or throw\n- `value()` - Get value or undefined with type narrowing\n- `unwrapOr(default)` - Get value or default\n- `unwrapOrElse(fn)` - Get value or compute default\n\n**Transforming:**\n- `map(fn)` - Transform Some value\n- `flatMap(fn)` - Chain Option-returning operations\n- `filter(predicate)` - Filter by predicate\n\n**Converting:**\n- `okOr(error)` - Convert to Result<T, E>\n\n#### Examples\n\n```typescript\n// filter - keep only matching values\nconst age = Some(25);\nconst adult = age.filter(a => a >= 18); // Some(25)\n\nconst child = Some(15);\nconst notAdult = child.filter(a => a >= 18); // None\n\n// okOr - convert to Result\nconst option = Some(42);\nconst result = option.okOr(\"Value not found\"); // Ok(42)\n\nconst empty = None();\nconst errResult = empty.okOr(\"Value not found\"); // Err(\"Value not found\")\n\n// Chaining\nconst processed = Some(\"  hello  \")\n  .map(s => s.trim())\n  .map(s => s.toUpperCase())\n  .filter(s => s.length > 3); // Some(\"HELLO\")\n```\n\n## Pattern Matching\n\nThe `match` function provides exhaustive pattern matching for Result, Option, primitives, and discriminated unions.\n\n### Matching Result and Option\n\n```typescript\nconst result: Result<number, string> = Ok(42);\n\nconst message = match(result, {\n  Ok: (value) => `Success: ${value}`,\n  Err: (error) => `Error: ${error}`,\n});\n\nconst option: Option<string> = Some(\"hello\");\n\nconst output = match(option, {\n  Some: (value) => value.toUpperCase(),\n  None: () => \"N/A\",\n});\n```\n\n### Matching Primitives (Enums, Strings, Numbers)\n\n```typescript\nenum Status {\n  Active = \"active\",\n  Inactive = \"inactive\",\n  Pending = \"pending\",\n}\n\nconst status = Status.Active;\n\n// Exhaustive matching - compile error if case missing\nconst message = match(status, {\n  active: () => \"User is active\",\n  inactive: () => \"User is inactive\",\n  pending: () => \"User is pending\",\n});\n\n// With default case\nconst simplified = match(status, {\n  active: () => \"Active\",\n  default: () => \"Other\",\n});\n```\n\n### Matching Mixed Primitive + Object Unions\n\nUnions that combine primitive strings and object variants (common in Rust-style error types):\n\n```typescript\ntype ServiceError =\n  | \"ConnectionFailed\"\n  | \"InvalidConfiguration\"\n  | { Other: [string, string] };\n\nconst err: ServiceError = { Other: [\"reason\", \"detail\"] };\n\n// Exhaustive - all cases required\nconst message = match(err, {\n  ConnectionFailed: () => \"Connection failed\",\n  InvalidConfiguration: () => \"Invalid config\",\n  Other: (data) => `Other error: ${data[0]} - ${data[1]}`,\n});\n\n// With default - partial cases allowed\nconst simplified = match(err, {\n  ConnectionFailed: () => \"Connection issue\",\n  default: () => \"Something else happened\",\n});\n```\n\nAlso works with complex object properties:\n\n```typescript\ntype AppError =\n  | \"NotFound\"\n  | { Details: { code: number; message: string } }\n  | { Metadata: string[] };\n\nconst error: AppError = { Details: { code: 404, message: \"Not found\" } };\n\nconst result = match(error, {\n  NotFound: () => \"Not found\",\n  Details: (details) => `Error ${details.code}: ${details.message}`,\n  Metadata: (meta) => meta.join(\", \"),\n});\n```\n\n### Matching Discriminated Unions\n\n```typescript\ntype Shape =\n  | { type: \"circle\"; radius: number }\n  | { type: \"rectangle\"; width: number; height: number }\n  | { type: \"triangle\"; base: number; height: number };\n\nconst shape: Shape = { type: \"circle\", radius: 10 };\n\nconst area = match(\n  shape,\n  {\n    circle: (s) => Math.PI * s.radius ** 2,\n    rectangle: (s) => s.width * s.height,\n    triangle: (s) => (s.base * s.height) / 2,\n  },\n  \"type\" // discriminant field\n);\n```\n\n## Real-World Examples\n\n### API Error Handling with Const Objects\n\n```typescript\n// Use const object instead of enum for better performance\nconst APIError = {\n  NotFound: \"NOT_FOUND\",\n  Unauthorized: \"UNAUTHORIZED\",\n  ServerError: \"SERVER_ERROR\",\n} as const;\n\ntype APIError = typeof APIError[keyof typeof APIError];\n\nasync function fetchUser(id: number): Promise<Result<User, APIError>> {\n  try {\n    const response = await fetch(`/api/users/${id}`);\n\n    if (response.status === 404) {\n      return Err(APIError.NotFound);\n    }\n    if (response.status === 401) {\n      return Err(APIError.Unauthorized);\n    }\n    if (!response.ok) {\n      return Err(APIError.ServerError);\n    }\n\n    const user = await response.json();\n    return Ok(user);\n  } catch (error) {\n    return Err(APIError.ServerError);\n  }\n}\n\n// Usage with pattern matching\nconst result = await fetchUser(123);\n\nconst message = match(result, {\n  Ok: (user) => `Welcome, ${user.name}!`,\n  Err: (error) =>\n    match(error, {\n      NOT_FOUND: () => \"User not found\",\n      UNAUTHORIZED: () => \"Please login\",\n      SERVER_ERROR: () => \"Server error, try again\",\n    }),\n});\n```\n\n### Form Validation with Custom Errors\n\n```typescript\nclass ValidationError {\n  constructor(\n    public field: string,\n    public message: string\n  ) {}\n}\n\nfunction validateEmail(email: string): Result<string, ValidationError> {\n  if (!email.includes(\"@\")) {\n    return Err(new ValidationError(\"email\", \"Invalid email format\"));\n  }\n  return Ok(email);\n}\n\nfunction validateAge(age: number): Result<number, ValidationError> {\n  if (age < 18) {\n    return Err(new ValidationError(\"age\", \"Must be 18 or older\"));\n  }\n  return Ok(age);\n}\n\n// Chaining validations\nconst validatedUser = validateEmail(\"test@example.com\")\n  .flatMap(email => validateAge(25).map(age => ({ email, age })))\n  .unwrapOr({ email: \"\", age: 0 });\n```\n\n### Database Query with Option\n\n```typescript\nfunction findUserById(id: number): Option<User> {\n  const user = database.users.find(u => u.id === id);\n  return user ? Some(user) : None();\n}\n\n// With filter\nconst activeUser = findUserById(123)\n  .filter(user => user.active)\n  .map(user => user.name)\n  .unwrapOr(\"No active user found\");\n\n// Convert to Result for error handling\nconst userResult = findUserById(123)\n  .okOr(new Error(\"User not found\"));\n\nif (userResult.isErr()) {\n  console.error(userResult.unwrapErr().message);\n}\n```\n\n## Performance\n\n### None Singleton\nThe `None()` function uses a singleton pattern, reusing the same instance:\n\n```typescript\nconst none1 = None();\nconst none2 = None();\nconsole.log(none1 === none2); // true - same instance!\n```\n\n**Impact:** 95% reduction in allocations for None-heavy workloads.\n\n### Match Early Return\nThe `match` function uses early return optimization, stopping at the first successful match:\n\n```typescript\n// Stops checking after isOk() succeeds\nmatch(result, {\n  Ok: (v) => v,\n  Err: (e) => 0,\n});\n```\n\n**Impact:** 20-40% faster than checking all conditions.\n\n## API Reference\n\n### Result<T, E>\n\n| Method | Description |\n|--------|-------------|\n| `isOk()` | Check if Result is Ok |\n| `isErr()` | Check if Result is Err |\n| `unwrap()` | Get value or throw |\n| `unwrapErr()` | Get error or throw |\n| `value()` | Get value/error with type narrowing |\n| `unwrapOr(default)` | Get value or default |\n| `unwrapOrElse(fn)` | Get value or compute default |\n| `map(fn)` | Transform Ok value |\n| `flatMap(fn)` | Chain Result-returning operations |\n| `mapErr(fn)` | Transform Err value |\n| `orElse(fn)` | Recover from errors |\n| `ok()` | Convert to Option<T> |\n\n### Option<T>\n\n| Method | Description |\n|--------|-------------|\n| `isSome()` | Check if Option is Some |\n| `isNone()` | Check if Option is None |\n| `unwrap()` | Get value or throw |\n| `value()` | Get value or undefined with type narrowing |\n| `unwrapOr(default)` | Get value or default |\n| `unwrapOrElse(fn)` | Get value or compute default |\n| `map(fn)` | Transform Some value |\n| `flatMap(fn)` | Chain Option-returning operations |\n| `filter(predicate)` | Filter by predicate |\n| `okOr(error)` | Convert to Result<T, E> |\n\n### match()\n\n**Signatures:**\n```typescript\n// Result matching\nmatch<T, E, R>(\n  matcher: Result<T, E>,\n  cases: { Ok: (value: T) => R; Err: (error: E) => R }\n): R\n\n// Option matching\nmatch<T, R>(\n  matcher: Option<T>,\n  cases: { Some: (value: T) => R; None: () => R }\n): R\n\n// Primitive matching (exhaustive)\nmatch<T extends string | number | symbol, R>(\n  matcher: T,\n  cases: { [K in T]: () => R }\n): R\n\n// Primitive matching (with default)\nmatch<T extends string | number | symbol, R>(\n  matcher: T,\n  cases: { [K in T]?: () => R } & { default: () => R }\n): R\n\n// Mixed primitive + object union (exhaustive)\nmatch<T extends PropertyKey | object, R>(\n  matcher: T,\n  cases: MatchCases<T, R, false>\n): R\n\n// Mixed primitive + object union (with default)\nmatch<T extends PropertyKey | object, R>(\n  matcher: T,\n  cases: MatchCases<T, R, true>\n): R\n\n// Discriminated union matching\nmatch<T, D extends keyof T, R>(\n  matcher: T,\n  cases: { [K in T[D]]: (value: Extract<T, { [P in D]: K }>) => R },\n  discriminant: D\n): R\n\n// Result → Option conversion\nmatch<T, E>(\n  matcher: Result<T, E>,\n  cases: {\n    Ok: (value: T) => Option<T>;\n    Err: (error: E) => Option<T>;\n  }\n): Option<T>\n\n// Option → Result conversion\nmatch<T, E>(\n  matcher: Option<T>,\n  cases: {\n    Some: (value: T) => Result<T, E>;\n    None: () => Result<T, E>;\n  }\n): Result<T, E>\n```\n\n## Migration from Other Libraries\n\n### From fp-ts\n\n```typescript\n// fp-ts\nimport * as E from \"fp-ts/Either\";\nconst result = E.right(42);\n\n// ResulTS\nconst result = Ok(42);\n```\n\n### From neverthrow\n\n```typescript\n// neverthrow\nimport { ok, err } from \"neverthrow\";\nconst result = ok(42);\n\n// ResulTS (same API!)\nconst result = Ok(42);\n```\n\n## TypeScript Configuration\n\nFor best experience, enable strict mode in `tsconfig.json`:\n\n```json\n{\n  \"compilerOptions\": {\n    \"strict\": true,\n    \"strictNullChecks\": true\n  }\n}\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit issues and pull requests.\n\n## License\n\nMIT\n\n## Roadmap\n\n### Planned Features\n\n**Result:**\n- [ ] `err()` - Convert to Option<E>\n- [ ] `transpose()` - Transpose Result<Option<T>, E>\n- [ ] `flatten()` - Flatten Result<Result<T, E>, E>\n\n**Option:**\n- [ ] `expect(message)` - Unwrap with custom error message\n- [ ] `and(optb)` - Logical AND for Options\n- [ ] `or(optb)` - Logical OR for Options\n- [ ] `zip(other)` - Zip two Options into tuple\n- [ ] `transpose()` - Transpose Option<Result<T, E>>\n\n**General:**\n- [ ] Async versions (AsyncResult, AsyncOption)\n- [ ] Do notation / for comprehensions\n- [ ] More utility functions\n\n## Credits\n\nInspired by:\n- Rust's `Result` and `Option` types\n- fp-ts\n- neverthrow\n","readmeFilename":"README.md"}