{"_id":"ts-safe","_rev":"11-e70a7e494ad806715b034d86fbf99e7e","name":"ts-safe","dist-tags":{"latest":"2.3.0"},"versions":{"0.0.1":{"name":"ts-safe","version":"0.0.1","keywords":["typescript","javascript","functional-programming","fp","chain","type-safe","error-handling","async","promise","monad","result-type","pipeline","effect","composable","utility","map","railway"],"author":{"name":"cging"},"license":"MIT","_id":"ts-safe@0.0.1","maintainers":[{"name":"cgoing","email":"neo.cgoing@gmail.com"}],"homepage":"https://github.com/cgoinglove/ts-safe#readme","bugs":{"url":"https://github.com/cgoinglove/ts-safe/issues"},"dist":{"shasum":"5bb75a32b22b0733272cc72d9f5d19ac5de59fea","tarball":"https://registry.npmjs.org/ts-safe/-/ts-safe-0.0.1.tgz","fileCount":22,"integrity":"sha512-UdlqnCm7woHYZogaxuMkjIjt9cMoz7vhuL6TWMDun/0BfC9p28Y9FcHPwn7IetZOKGVA4JtuDV6e9mZUkvwdSw==","signatures":[{"sig":"MEYCIQD4Et8Kmk1pXzfuFD+nr4vgCI+ChXu7L2cz/TxelmYd0gIhAKVs3lDwcFInfP8jYyfrEnimRg0HQaz8Dog/ScmC4HdK","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":70355},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"5585de5f198e35d29865584b8379d8c6a53be175","scripts":{"lint":"eslint .","test":"vitest","build":"tsup","format":"prettier --write ./**/*.ts","prepare":"husky install","release":"npm run prepare:release && npm run build && npm run prepare:version && npm publish","type-check":"tsc --noEmit","lint-staged":"lint-staged","prepare:release":"npm run format && npm run type-check && npm run test run","prepare:version":"npm --no-git-tag-version version patch"},"_npmUser":{"name":"cgoing","email":"neo.cgoing@gmail.com"},"prettier":{"semi":true,"useTabs":false,"tabWidth":2,"endOfLine":"lf","printWidth":120,"quoteProps":"as-needed","arrowParens":"always","singleQuote":true,"trailingComma":"es5","bracketSpacing":true,"jsxSingleQuote":false,"bracketSameLine":false,"embeddedLanguageFormatting":"auto"},"repository":{"url":"git+https://github.com/cgoinglove/ts-safe.git","type":"git"},"_npmVersion":"10.2.1","description":"A functional, type-safe utility library for elegant error handling and asynchronous operations in JavaScript/TypeScript.","directories":{},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write"]},"sideEffects":false,"_nodeVersion":"20.9.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.6","husky":"^8.0.3","eslint":"^9.19.0","vitest":"^3.0.6","globals":"^15.14.0","prettier":"^3.2.5","@eslint/js":"^9.19.0","typescript":"~5.7.2","@types/node":"^22.13.5","lint-staged":"^14.0.1","typescript-eslint":"^8.22.0"},"_npmOperationalInternal":{"tmp":"tmp/ts-safe_0.0.1_1741019692630_0.7037613356153383","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"ts-safe","version":"0.0.2","keywords":["typescript","javascript","functional-programming","fp","chain","type-safe","error-handling","async","promise","monad","result-type","pipeline","effect","composable","utility","map","railway"],"author":{"name":"cging"},"license":"MIT","_id":"ts-safe@0.0.2","maintainers":[{"name":"cgoing","email":"neo.cgoing@gmail.com"}],"homepage":"https://github.com/cgoinglove/ts-safe#readme","bugs":{"url":"https://github.com/cgoinglove/ts-safe/issues"},"dist":{"shasum":"5bea683598e809f19c5eec3ae8782ef61dafafc4","tarball":"https://registry.npmjs.org/ts-safe/-/ts-safe-0.0.2.tgz","fileCount":7,"integrity":"sha512-BbSVD2EPWJFdmu+qAYiohByTDfIItKkAt33+ECa+iA7aOM/zjlk4j1pLYomG+MSmTMACdOq0xEwFYfXwElcsjg==","signatures":[{"sig":"MEUCIQCeotY5mbXNu05Q1lcDCwUuU1uhlH9gKBlpAcMHnf55EQIgDlrh1oEDifrAyfxQQJXCUQrSkgrzzuivbBR+S7D+1wk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35001},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"5585de5f198e35d29865584b8379d8c6a53be175","scripts":{"lint":"eslint .","test":"vitest","build":"tsup","format":"prettier --write ./**/*.ts","prepare":"husky install","release":"npm run prepare:release && npm run build && npm run prepare:version && npm publish","type-check":"tsc --noEmit","lint-staged":"lint-staged","prepare:release":"npm run format && npm run type-check && npm run test run","prepare:version":"npm --no-git-tag-version version patch"},"_npmUser":{"name":"cgoing","email":"neo.cgoing@gmail.com"},"prettier":{"semi":true,"useTabs":false,"tabWidth":2,"endOfLine":"lf","printWidth":120,"quoteProps":"as-needed","arrowParens":"always","singleQuote":true,"trailingComma":"es5","bracketSpacing":true,"jsxSingleQuote":false,"bracketSameLine":false,"embeddedLanguageFormatting":"auto"},"repository":{"url":"git+https://github.com/cgoinglove/ts-safe.git","type":"git"},"_npmVersion":"10.2.1","description":"A functional, type-safe utility library for elegant error handling and asynchronous operations in JavaScript/TypeScript.","directories":{},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write"]},"sideEffects":false,"_nodeVersion":"20.9.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.6","husky":"^8.0.3","eslint":"^9.19.0","vitest":"^3.0.6","globals":"^15.14.0","prettier":"^3.2.5","@eslint/js":"^9.19.0","typescript":"~5.7.2","@types/node":"^22.13.5","lint-staged":"^14.0.1","typescript-eslint":"^8.22.0"},"_npmOperationalInternal":{"tmp":"tmp/ts-safe_0.0.2_1741020472937_0.06512968531902952","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"ts-safe","version":"0.0.3","keywords":["typescript","javascript","functional-programming","fp","chain","type-safe","error-handling","async","promise","monad","result-type","pipeline","effect","composable","utility","map","railway"],"author":{"name":"cging"},"license":"MIT","_id":"ts-safe@0.0.3","maintainers":[{"name":"cgoing","email":"neo.cgoing@gmail.com"}],"homepage":"https://github.com/cgoinglove/ts-safe#readme","bugs":{"url":"https://github.com/cgoinglove/ts-safe/issues"},"dist":{"shasum":"3813488d397c632de46beb80a3e13be812cc57a7","tarball":"https://registry.npmjs.org/ts-safe/-/ts-safe-0.0.3.tgz","fileCount":8,"integrity":"sha512-yiN9h//jf5OJS+G4B4dKyx5OVmJ0ezxGp7P97l2iD1q6+M+B+3Ev1+qT7+RleoHm90a01vDYMj7wy8FXqvJr5A==","signatures":[{"sig":"MEQCIG9UOh5gIcDJ2QK9seyr2BV7dAiM48ErRTSTqKregoPfAiATVshCLO6KJTPAmJqypsH0LLTF+zb/m5HXC2rxm2luLw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44253},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"8ac7c7c139e051e105e40177b9d1929edfae9d93","scripts":{"lint":"eslint .","test":"vitest","build":"tsup","format":"prettier --write ./**/*.ts","prepare":"husky install","release":"npm run prepare:release && npm run build && npm run prepare:version && npm publish","type-check":"tsc --noEmit","lint-staged":"lint-staged","prepare:release":"npm run format && npm run type-check && npm run test run","prepare:version":"npm --no-git-tag-version version patch"},"_npmUser":{"name":"cgoing","email":"neo.cgoing@gmail.com"},"prettier":{"semi":true,"useTabs":false,"tabWidth":2,"endOfLine":"lf","printWidth":120,"quoteProps":"as-needed","arrowParens":"always","singleQuote":true,"trailingComma":"es5","bracketSpacing":true,"jsxSingleQuote":false,"bracketSameLine":false,"embeddedLanguageFormatting":"auto"},"repository":{"url":"git+https://github.com/cgoinglove/ts-safe.git","type":"git"},"_npmVersion":"10.2.1","description":"A functional, type-safe utility library for elegant error handling and asynchronous operations in JavaScript/TypeScript.","directories":{},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write"]},"sideEffects":false,"_nodeVersion":"20.9.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.6","husky":"^8.0.3","eslint":"^9.19.0","vitest":"^3.0.6","globals":"^15.14.0","prettier":"^3.2.5","@eslint/js":"^9.19.0","typescript":"~5.7.2","@types/node":"^22.13.5","lint-staged":"^14.0.1","typescript-eslint":"^8.22.0"},"_npmOperationalInternal":{"tmp":"tmp/ts-safe_0.0.3_1741454674842_0.32640825548358277","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"ts-safe","version":"0.0.4","keywords":["typescript","javascript","functional-programming","fp","chain","type-safe","error-handling","async","promise","monad","result-type","pipeline","effect","composable","utility","map","railway"],"author":{"name":"cging"},"license":"MIT","_id":"ts-safe@0.0.4","maintainers":[{"name":"cgoing","email":"neo.cgoing@gmail.com"}],"homepage":"https://github.com/cgoinglove/ts-safe#readme","bugs":{"url":"https://github.com/cgoinglove/ts-safe/issues"},"dist":{"shasum":"7a332097bdb141d14d1be66c326f9a1ef1445a68","tarball":"https://registry.npmjs.org/ts-safe/-/ts-safe-0.0.4.tgz","fileCount":7,"integrity":"sha512-UmrDAIUiqzSJrSa4VuJPdvcuPC7cHg/3GBm0iBApHhurXdJ5SAUaSocZcaJnPkSV8V1sE4v5SapCo9wDU4T1cg==","signatures":[{"sig":"MEQCIAggtd/69XZdazy5G7V+4+G8nM32rQ9eqf+YcREgHlGaAiBEqzMLd6dTkzA4Ig2A4hAyoiaUTSTjuIhZTk0+cCZiqg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35007},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"9e2f2f7912e6efe73dead11afa4042b3c51ef606","scripts":{"lint":"eslint .","test":"vitest","build":"tsup","format":"prettier --write ./**/*.ts","prepare":"husky install","release":"npm run prepare:release && npm run build && npm run prepare:version && npm publish","type-check":"tsc --noEmit","lint-staged":"lint-staged","prepare:release":"npm run format && npm run type-check && npm run test run","prepare:version":"npm --no-git-tag-version version patch"},"_npmUser":{"name":"cgoing","email":"neo.cgoing@gmail.com"},"prettier":{"semi":true,"useTabs":false,"tabWidth":2,"endOfLine":"lf","printWidth":120,"quoteProps":"as-needed","arrowParens":"always","singleQuote":true,"trailingComma":"es5","bracketSpacing":true,"jsxSingleQuote":false,"bracketSameLine":false,"embeddedLanguageFormatting":"auto"},"repository":{"url":"git+https://github.com/cgoinglove/ts-safe.git","type":"git"},"_npmVersion":"10.2.1","description":"A functional, type-safe utility library for elegant error handling and asynchronous operations in JavaScript/TypeScript.","directories":{},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write"]},"sideEffects":false,"_nodeVersion":"20.9.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.6","husky":"^8.0.3","eslint":"^9.19.0","vitest":"^3.0.6","globals":"^15.14.0","prettier":"^3.2.5","@eslint/js":"^9.19.0","typescript":"~5.7.2","@types/node":"^22.13.5","lint-staged":"^14.0.1","typescript-eslint":"^8.22.0"},"_npmOperationalInternal":{"tmp":"tmp/ts-safe_0.0.4_1741533425306_0.4296673927463599","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"ts-safe","version":"0.0.5","keywords":["typescript","javascript","functional-programming","fp","chain","type-safe","error-handling","async","promise","monad","result-type","pipeline","effect","composable","utility","map","railway"],"author":{"name":"cging"},"license":"MIT","_id":"ts-safe@0.0.5","maintainers":[{"name":"cgoing","email":"neo.cgoing@gmail.com"}],"homepage":"https://github.com/cgoinglove/ts-safe#readme","bugs":{"url":"https://github.com/cgoinglove/ts-safe/issues"},"dist":{"shasum":"6be73c838f1e6dc1233a80cb8d8c7e7e5919a2bf","tarball":"https://registry.npmjs.org/ts-safe/-/ts-safe-0.0.5.tgz","fileCount":7,"integrity":"sha512-Bai5dobPYWmDurdCm3G/YUhB1gKu8MPudtg6bwRrLNVuUJ7vyXTad6NOYmdksBY4m3YV5JmbDvkdJqiX6Q7CSQ==","signatures":[{"sig":"MEUCICCVG6wA105s/FHgihikzAnWCtaEJ+FEKCWJzS10ZvwJAiEAjfhN7iH27wIJYw0xRXboN74VEwNzNJ0cGCyUv7OwCMk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":38329},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"017b61aac2386e8e8be010594250e05036b52b54","scripts":{"lint":"eslint .","test":"vitest","build":"tsup","format":"prettier --write ./**/*.ts","prepare":"husky install","release":"npm run prepare:release && npm run build && npm run prepare:version && npm publish","type-check":"tsc --noEmit","lint-staged":"lint-staged","prepare:release":"npm run format && npm run type-check && npm run test run","prepare:version":"npm --no-git-tag-version version patch"},"_npmUser":{"name":"cgoing","email":"neo.cgoing@gmail.com"},"prettier":{"semi":true,"useTabs":false,"tabWidth":2,"endOfLine":"lf","printWidth":120,"quoteProps":"as-needed","arrowParens":"always","singleQuote":true,"trailingComma":"es5","bracketSpacing":true,"jsxSingleQuote":false,"bracketSameLine":false,"embeddedLanguageFormatting":"auto"},"repository":{"url":"git+https://github.com/cgoinglove/ts-safe.git","type":"git"},"_npmVersion":"10.2.1","description":"A functional, type-safe utility library for elegant error handling and asynchronous operations in JavaScript/TypeScript.","directories":{},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write"]},"sideEffects":false,"_nodeVersion":"20.9.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.6","husky":"^8.0.3","eslint":"^9.19.0","vitest":"^3.0.6","globals":"^15.14.0","prettier":"^3.2.5","@eslint/js":"^9.19.0","typescript":"~5.7.2","@types/node":"^22.13.5","lint-staged":"^14.0.1","typescript-eslint":"^8.22.0"},"_npmOperationalInternal":{"tmp":"tmp/ts-safe_0.0.5_1743951408013_0.09033355080856764","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"ts-safe","version":"1.0.0","keywords":["typescript","javascript","functional-programming","fp","chain","type-safe","error-handling","async","promise","monad","result-type","pipeline","effect","composable","utility","map","railway"],"author":{"name":"cging"},"license":"MIT","_id":"ts-safe@1.0.0","maintainers":[{"name":"cgoing","email":"neo.cgoing@gmail.com"}],"homepage":"https://github.com/cgoinglove/ts-safe#readme","bugs":{"url":"https://github.com/cgoinglove/ts-safe/issues"},"dist":{"shasum":"df79572f9daa37017c7c8a742840509130abd7d4","tarball":"https://registry.npmjs.org/ts-safe/-/ts-safe-1.0.0.tgz","fileCount":7,"integrity":"sha512-oFzyk/PbZaLUmIFANwmWkjhV1k4w2sb2NB77DLXJrI6jMFeEPcejzW6DGTYvp23ia517/VvxfKhBAeXpWns70Q==","signatures":[{"sig":"MEUCIQCC0ubtF8/p6F/rYElMVYEHCR0pyxWpWsm1Ag2uwTFKDwIgQnnJTkRBc3pBbw2jURVubwy8K1LHcvxYDYwmxU639wc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44968},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"fa64b8d8bf0a29db8c505b43cb8d2af526cc6146","scripts":{"lint":"eslint .","test":"vitest","build":"tsup","format":"prettier --write ./**/*.ts","prepare":"husky install","release":"npm run prepare:release && npm run build && npm run prepare:version && npm publish","type-check":"tsc --noEmit","lint-staged":"lint-staged","release:major":"npm run prepare:release && npm run build && npm run prepare:version:major && npm publish","release:minor":"npm run prepare:release && npm run build && npm run prepare:version:minor && npm publish","prepare:release":"npm run format && npm run type-check && npm run test run","prepare:version":"npm --no-git-tag-version version patch","prepare:version:major":"npm --no-git-tag-version version major","prepare:version:minor":"npm --no-git-tag-version version minor"},"_npmUser":{"name":"cgoing","email":"neo.cgoing@gmail.com"},"prettier":{"semi":true,"useTabs":false,"tabWidth":2,"endOfLine":"lf","printWidth":120,"quoteProps":"as-needed","arrowParens":"always","singleQuote":true,"trailingComma":"es5","bracketSpacing":true,"jsxSingleQuote":false,"bracketSameLine":false,"embeddedLanguageFormatting":"auto"},"repository":{"url":"git+https://github.com/cgoinglove/ts-safe.git","type":"git"},"_npmVersion":"10.9.3","description":"A functional, type-safe utility library for elegant error handling and asynchronous operations in JavaScript/TypeScript.","directories":{},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write"]},"sideEffects":false,"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.6","husky":"^8.0.3","eslint":"^9.19.0","vitest":"^3.0.6","globals":"^15.14.0","prettier":"^3.2.5","@eslint/js":"^9.19.0","typescript":"~5.7.2","@types/node":"^22.13.5","lint-staged":"^14.0.1","typescript-eslint":"^8.22.0"},"_npmOperationalInternal":{"tmp":"tmp/ts-safe_1.0.0_1771474858316_0.7253633387884872","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"ts-safe","version":"2.0.0","keywords":["typescript","javascript","functional-programming","fp","chain","type-safe","error-handling","async","promise","monad","result-type","pipeline","effect","composable","utility","map","railway"],"author":{"name":"cging"},"license":"MIT","_id":"ts-safe@2.0.0","maintainers":[{"name":"cgoing","email":"neo.cgoing@gmail.com"}],"homepage":"https://github.com/cgoinglove/ts-safe#readme","bugs":{"url":"https://github.com/cgoinglove/ts-safe/issues"},"dist":{"shasum":"4f75b4d981f24976a26701dd2644eefa7f0ba714","tarball":"https://registry.npmjs.org/ts-safe/-/ts-safe-2.0.0.tgz","fileCount":7,"integrity":"sha512-TxVcmyN1TD2Qz0PFYcj+nyCZDRXmDxB49HzpuYO4QmTb4RIwVdxvs4Gg40hruXCPhaNjp+tNRPHjVSS3qgqEDw==","signatures":[{"sig":"MEUCIDM2QY10ZhPsLFnqRTfU9jo9UwyVl7qxybKnjXxYVn0PAiEAyg0/DS6KP9IkesUe262qesKfW+gW2gzKrLbC7Gho85U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":45204},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"fa64b8d8bf0a29db8c505b43cb8d2af526cc6146","scripts":{"lint":"eslint .","test":"vitest","build":"tsup","format":"prettier --write ./**/*.ts","prepare":"husky install","release":"npm run prepare:release && npm run build && npm run prepare:version && npm publish","type-check":"tsc --noEmit","lint-staged":"lint-staged","release:major":"npm run prepare:release && npm run build && npm run prepare:version:major && npm publish","release:minor":"npm run prepare:release && npm run build && npm run prepare:version:minor && npm publish","prepare:release":"npm run format && npm run type-check && npm run test run","prepare:version":"npm --no-git-tag-version version patch","prepare:version:major":"npm --no-git-tag-version version major","prepare:version:minor":"npm --no-git-tag-version version minor"},"_npmUser":{"name":"cgoing","email":"neo.cgoing@gmail.com"},"prettier":{"semi":true,"useTabs":false,"tabWidth":2,"endOfLine":"lf","printWidth":120,"quoteProps":"as-needed","arrowParens":"always","singleQuote":true,"trailingComma":"es5","bracketSpacing":true,"jsxSingleQuote":false,"bracketSameLine":false,"embeddedLanguageFormatting":"auto"},"repository":{"url":"git+https://github.com/cgoinglove/ts-safe.git","type":"git"},"_npmVersion":"10.9.3","description":"A functional, type-safe utility library for elegant error handling and asynchronous operations in JavaScript/TypeScript.","directories":{},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write"]},"sideEffects":false,"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.6","husky":"^8.0.3","eslint":"^9.19.0","vitest":"^3.0.6","globals":"^15.14.0","prettier":"^3.2.5","@eslint/js":"^9.19.0","typescript":"~5.7.2","@types/node":"^22.13.5","lint-staged":"^14.0.1","typescript-eslint":"^8.22.0"},"_npmOperationalInternal":{"tmp":"tmp/ts-safe_2.0.0_1775440095933_0.7231844500659035","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"ts-safe","version":"2.1.0","keywords":["typescript","javascript","functional-programming","fp","chain","type-safe","error-handling","async","promise","monad","result-type","pipeline","effect","composable","utility","map","railway"],"author":{"name":"cging"},"license":"MIT","_id":"ts-safe@2.1.0","maintainers":[{"name":"cgoing","email":"neo.cgoing@gmail.com"}],"homepage":"https://github.com/cgoinglove/ts-safe#readme","bugs":{"url":"https://github.com/cgoinglove/ts-safe/issues"},"dist":{"shasum":"e5a7fdd094ceb1f014551116d702c773fb883fbc","tarball":"https://registry.npmjs.org/ts-safe/-/ts-safe-2.1.0.tgz","fileCount":7,"integrity":"sha512-TwUllF1oB4q44jh/tSi+SmzNUGTnrNmHX1bnsloJ9qS6DeR1zmeTTZKmvjjPKQe3hDihR6qgw9QEvTqisGVZmw==","signatures":[{"sig":"MEUCIQCYhFfxjZeyVnQlkd/Z3h/OdfLFxKcX7TrI4f0LnR4WXAIgMy9hgwdZjb2XFtiIcVcy2K1IJGpKtw7jJk00i/2LbOU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":45978},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"ba86e3eec08a8fd24c88901337a6452df1aa27d5","scripts":{"lint":"eslint .","test":"vitest","build":"tsup","format":"prettier --write ./**/*.ts","prepare":"husky install","release":"npm run prepare:release && npm run build && npm run prepare:version && npm publish","type-check":"tsc --noEmit","lint-staged":"lint-staged","release:major":"npm run prepare:release && npm run build && npm run prepare:version:major && npm publish","release:minor":"npm run prepare:release && npm run build && npm run prepare:version:minor && npm publish","prepare:release":"npm run format && npm run type-check && npm run test run","prepare:version":"npm --no-git-tag-version version patch","prepare:version:major":"npm --no-git-tag-version version major","prepare:version:minor":"npm --no-git-tag-version version minor"},"_npmUser":{"name":"cgoing","email":"neo.cgoing@gmail.com"},"prettier":{"semi":true,"useTabs":false,"tabWidth":2,"endOfLine":"lf","printWidth":120,"quoteProps":"as-needed","arrowParens":"always","singleQuote":true,"trailingComma":"es5","bracketSpacing":true,"jsxSingleQuote":false,"bracketSameLine":false,"embeddedLanguageFormatting":"auto"},"repository":{"url":"git+https://github.com/cgoinglove/ts-safe.git","type":"git"},"_npmVersion":"10.9.3","description":"A functional, type-safe utility library for elegant error handling and asynchronous operations in JavaScript/TypeScript.","directories":{},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write"]},"sideEffects":false,"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.6","husky":"^8.0.3","eslint":"^9.19.0","vitest":"^3.0.6","globals":"^15.14.0","prettier":"^3.2.5","@eslint/js":"^9.19.0","typescript":"~5.7.2","@types/node":"^22.13.5","lint-staged":"^14.0.1","typescript-eslint":"^8.22.0"},"_npmOperationalInternal":{"tmp":"tmp/ts-safe_2.1.0_1775697260263_0.41018532772277894","host":"s3://npm-registry-packages-npm-production"}},"2.2.0":{"name":"ts-safe","version":"2.2.0","keywords":["typescript","javascript","functional-programming","fp","chain","type-safe","error-handling","async","promise","monad","result-type","pipeline","effect","composable","utility","map","railway"],"author":{"name":"cging"},"license":"MIT","_id":"ts-safe@2.2.0","maintainers":[{"name":"cgoing","email":"neo.cgoing@gmail.com"}],"homepage":"https://github.com/cgoinglove/ts-safe#readme","bugs":{"url":"https://github.com/cgoinglove/ts-safe/issues"},"dist":{"shasum":"adc373f9877479222a6e61d89453b40bc0af59f4","tarball":"https://registry.npmjs.org/ts-safe/-/ts-safe-2.2.0.tgz","fileCount":7,"integrity":"sha512-oi9gLRmAUV557H2lfKnxBtcu5dDff5v0fskRJWpjEMp2jj3XI8aWGCTGH88r4mmMFkYXtkPqLuSB6LxCqLI+1A==","signatures":[{"sig":"MEQCIE6kfqZ9z+gaMuzuNzJUUEOu4HP3tBRU+hlcYg7RGNkgAiBwY6s6pMYbjyQVv1SnoylhVHMvA0s1YHzHCr3OwSQVZw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49428},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"124e6567a1d65b3eb92c32acde296106d145d783","scripts":{"lint":"eslint .","test":"vitest","build":"tsup","format":"prettier --write ./**/*.ts","prepare":"husky install","release":"npm run prepare:release && npm run build && npm run prepare:version && npm publish","type-check":"tsc --noEmit","lint-staged":"lint-staged","release:major":"npm run prepare:release && npm run build && npm run prepare:version:major && npm publish","release:minor":"npm run prepare:release && npm run build && npm run prepare:version:minor && npm publish","prepare:release":"npm run format && npm run type-check && npm run test run","prepare:version":"npm --no-git-tag-version version patch","prepare:version:major":"npm --no-git-tag-version version major","prepare:version:minor":"npm --no-git-tag-version version minor"},"_npmUser":{"name":"cgoing","email":"neo.cgoing@gmail.com"},"prettier":{"semi":true,"useTabs":false,"tabWidth":2,"endOfLine":"lf","printWidth":120,"quoteProps":"as-needed","arrowParens":"always","singleQuote":true,"trailingComma":"es5","bracketSpacing":true,"jsxSingleQuote":false,"bracketSameLine":false,"embeddedLanguageFormatting":"auto"},"repository":{"url":"git+https://github.com/cgoinglove/ts-safe.git","type":"git"},"_npmVersion":"10.9.3","description":"A functional, type-safe utility library for elegant error handling and asynchronous operations in JavaScript/TypeScript.","directories":{},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write"]},"sideEffects":false,"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.6","husky":"^8.0.3","eslint":"^9.19.0","vitest":"^3.0.6","globals":"^15.14.0","prettier":"^3.2.5","@eslint/js":"^9.19.0","typescript":"~5.7.2","@types/node":"^22.13.5","lint-staged":"^14.0.1","typescript-eslint":"^8.22.0"},"_npmOperationalInternal":{"tmp":"tmp/ts-safe_2.2.0_1777513509448_0.475233479947371","host":"s3://npm-registry-packages-npm-production"}},"2.2.1":{"name":"ts-safe","version":"2.2.1","keywords":["typescript","javascript","functional-programming","fp","chain","type-safe","error-handling","async","promise","monad","result-type","pipeline","effect","composable","utility","map","railway"],"author":{"name":"cging"},"license":"MIT","_id":"ts-safe@2.2.1","maintainers":[{"name":"cgoing","email":"neo.cgoing@gmail.com"}],"homepage":"https://github.com/cgoinglove/ts-safe#readme","bugs":{"url":"https://github.com/cgoinglove/ts-safe/issues"},"dist":{"shasum":"a9bae932fef40b664b529284de7dac55793648a2","tarball":"https://registry.npmjs.org/ts-safe/-/ts-safe-2.2.1.tgz","fileCount":7,"integrity":"sha512-pqEKhBhglnaxLbJL/Av5Oy3Ea8Gmlew0nz1f0zHy31HcuZkCcCXiI6UM4pb60lQ2ibngi8Fc3rfXnKfhWwD8lw==","signatures":[{"sig":"MEUCIG987Hxk4iLBMHhERCIuapV46vQKOQQM0oQ8zSzXDqUaAiEAwKifrF/jpLQ+dI9lncvsnIGxU10rnJuYfdkwTfX/n98=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49490},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=14.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"5ce0abb5c074693ee3ba20c69ce2522b484155cd","scripts":{"lint":"eslint .","test":"vitest","build":"tsup","format":"prettier --write ./**/*.ts","prepare":"husky install","release":"npm run prepare:release && npm run build && npm run prepare:version && npm publish","type-check":"tsc --noEmit","lint-staged":"lint-staged","release:major":"npm run prepare:release && npm run build && npm run prepare:version:major && npm publish","release:minor":"npm run prepare:release && npm run build && npm run prepare:version:minor && npm publish","release:patch":"npm run prepare:release && npm run build && npm run prepare:version:patch && npm publish","prepare:release":"npm run format && npm run type-check && npm run test run","prepare:version":"npm --no-git-tag-version version patch","prepare:version:major":"npm --no-git-tag-version version major","prepare:version:minor":"npm --no-git-tag-version version minor","prepare:version:patch":"npm --no-git-tag-version version patch"},"_npmUser":{"name":"cgoing","email":"neo.cgoing@gmail.com"},"prettier":{"semi":true,"useTabs":false,"tabWidth":2,"endOfLine":"lf","printWidth":120,"quoteProps":"as-needed","arrowParens":"always","singleQuote":true,"trailingComma":"es5","bracketSpacing":true,"jsxSingleQuote":false,"bracketSameLine":false,"embeddedLanguageFormatting":"auto"},"repository":{"url":"git+https://github.com/cgoinglove/ts-safe.git","type":"git"},"_npmVersion":"10.9.3","description":"A functional, type-safe utility library for elegant error handling and asynchronous operations in JavaScript/TypeScript.","directories":{},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write"]},"sideEffects":false,"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.6","husky":"^8.0.3","eslint":"^9.19.0","vitest":"^3.0.6","globals":"^15.14.0","prettier":"^3.2.5","@eslint/js":"^9.19.0","typescript":"~5.7.2","@types/node":"^22.13.5","lint-staged":"^14.0.1","typescript-eslint":"^8.22.0"},"_npmOperationalInternal":{"tmp":"tmp/ts-safe_2.2.1_1777545246284_0.9468838587264079","host":"s3://npm-registry-packages-npm-production"}},"2.3.0":{"name":"ts-safe","description":"A functional, type-safe utility library for elegant error handling and asynchronous operations in JavaScript/TypeScript.","keywords":["typescript","javascript","functional-programming","fp","chain","type-safe","error-handling","async","promise","monad","result-type","pipeline","effect","composable","utility","map","railway"],"author":{"name":"cging"},"license":"MIT","version":"2.3.0","type":"module","sideEffects":false,"main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js"}},"scripts":{"prepare":"husky install","test":"vitest","lint-staged":"lint-staged","build":"tsup","format":"prettier --write ./**/*.ts","type-check":"tsc --noEmit","lint":"eslint .","prepare:release":"npm run format && npm run type-check && npm run test run","prepare:version":"npm --no-git-tag-version version patch","prepare:version:patch":"npm --no-git-tag-version version patch","prepare:version:minor":"npm --no-git-tag-version version minor","prepare:version:major":"npm --no-git-tag-version version major","release":"npm run prepare:release && npm run build && npm run prepare:version && npm publish","release:patch":"npm run prepare:release && npm run build && npm run prepare:version:patch && npm publish","release:minor":"npm run prepare:release && npm run build && npm run prepare:version:minor && npm publish","release:major":"npm run prepare:release && npm run build && npm run prepare:version:major && npm publish"},"devDependencies":{"@eslint/js":"^9.19.0","@types/node":"^22.13.5","eslint":"^9.19.0","globals":"^15.14.0","husky":"^8.0.3","lint-staged":"^14.0.1","prettier":"^3.2.5","tsup":"^8.3.6","typescript":"~5.7.2","typescript-eslint":"^8.22.0","vitest":"^3.0.6"},"lint-staged":{"*.{ts,tsx}":["eslint --fix","prettier --write"]},"engines":{"node":">=14.0.0"},"repository":{"type":"git","url":"git+https://github.com/cgoinglove/ts-safe.git"},"prettier":{"printWidth":120,"tabWidth":2,"useTabs":false,"semi":true,"singleQuote":true,"quoteProps":"as-needed","jsxSingleQuote":false,"trailingComma":"es5","bracketSpacing":true,"bracketSameLine":false,"arrowParens":"always","endOfLine":"lf","embeddedLanguageFormatting":"auto"},"_id":"ts-safe@2.3.0","gitHead":"a911a5700f941b1795c4fd189b12f5a25c644c8c","bugs":{"url":"https://github.com/cgoinglove/ts-safe/issues"},"homepage":"https://github.com/cgoinglove/ts-safe#readme","_nodeVersion":"22.19.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-b9VFK4/o49x7ScP+NnLvQw11xqGR5BkbcbAQjJqm3k4scCer7fDp43BJPZSGzMkcLwIHW5SQarxWuzSCAcCqVg==","shasum":"4403fc8ec85c93ad21d47aed6447c7a28c33cbe4","tarball":"https://registry.npmjs.org/ts-safe/-/ts-safe-2.3.0.tgz","fileCount":7,"unpackedSize":51144,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFZoF3PIkXylCpv02AlAbh5kX6VDdKElQG6R/9kKmOrjAiEAxuPloiNW4ciQrECfl5BqP6kBdY6E+4AyzjPThV0UtKI="}]},"_npmUser":{"name":"cgoing","email":"neo.cgoing@gmail.com"},"directories":{},"maintainers":[{"name":"cgoing","email":"neo.cgoing@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ts-safe_2.3.0_1787113325356_0.3503935386667141"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-03T16:34:52.629Z","modified":"2026-08-19T04:22:05.649Z","0.0.1":"2025-03-03T16:34:52.788Z","0.0.2":"2025-03-03T16:47:53.140Z","0.0.3":"2025-03-08T17:24:35.014Z","0.0.4":"2025-03-09T15:17:05.529Z","0.0.5":"2025-04-06T14:56:48.210Z","1.0.0":"2026-02-19T04:20:58.468Z","2.0.0":"2026-04-06T01:48:16.094Z","2.1.0":"2026-04-09T01:14:20.419Z","2.2.0":"2026-04-30T01:45:09.614Z","2.2.1":"2026-04-30T10:34:06.423Z","2.3.0":"2026-08-19T04:22:05.517Z"},"bugs":{"url":"https://github.com/cgoinglove/ts-safe/issues"},"author":{"name":"cging"},"license":"MIT","homepage":"https://github.com/cgoinglove/ts-safe#readme","keywords":["typescript","javascript","functional-programming","fp","chain","type-safe","error-handling","async","promise","monad","result-type","pipeline","effect","composable","utility","map","railway"],"repository":{"type":"git","url":"git+https://github.com/cgoinglove/ts-safe.git"},"description":"A functional, type-safe utility library for elegant error handling and asynchronous operations in JavaScript/TypeScript.","maintainers":[{"name":"cgoing","email":"neo.cgoing@gmail.com"}],"readme":"# ts-safe\n\n[![npm](https://img.shields.io/npm/v/ts-safe)](https://www.npmjs.com/package/ts-safe)\n[![bundle size](https://img.shields.io/bundlephobia/minzip/ts-safe)](https://bundlephobia.com/package/ts-safe)\n[![zero dependencies](https://img.shields.io/badge/dependencies-0-green)](https://www.npmjs.com/package/ts-safe)\n\nType-safe error handling for TypeScript — with automatic Promise inference.\n\n```ts\nconst name = await safe(() => fetch('/api/user'))\n  .map(res => res.json())           // transform — value changes\n  .ifOk(user => saveToDb(user))         // side effect — can break chain, value preserved\n  .observeOk(user => console.log(user))// observe — can't break chain, just watch\n  .recover(() => defaultUser)       // recover — replace error with fallback\n  .map(user => user.name)           // transform — type flows automatically\n  .unwrap();                        // extract — Promise<string>\n```\n\n## Why ts-safe?\n\nThere are great Result/Either libraries for TypeScript — [neverthrow](https://github.com/supermacro/neverthrow), [fp-ts](https://github.com/gcanti/fp-ts), [Effect](https://github.com/Effect-TS/effect). But they either require you to learn a new paradigm, or don't handle the sync → async boundary well.\n\n**ts-safe is different:**\n\n### 1. Promises just work\n\nMost Result libraries force you to choose between sync and async variants, or wrap everything in a Task/Effect monad. ts-safe handles Promise transitions **automatically at the type level**:\n\n```ts\nsafe(1)                          // Safe<number>\n  .map(x => x + 1)              // Safe<number>          — still sync\n  .map(async x => fetchData(x)) // Safe<Promise<Data>>   — now async\n  .map(data => data.name)        // Safe<Promise<string>> — stays async\n  .unwrap()                      // Promise<string>       — awaitable\n```\n\nNo `TaskEither`, no `ResultAsync`, no separate API. The type system tracks it for you.\n\n### 2. Minimal API, maximum clarity\n\nEvery method name tells you two things: **what it does** and **whether it affects the chain**.\n\n```\nChain affected:     map · flatMap · ifOk · ifFail · recover\nChain unaffected:   observe · observeOk · observeError\nExtract result:     unwrap · orElse · match · isOk\n```\n\nThat's it. No `chain`, `andThen`, `mapLeft`, `bimap`, `fold`, `tryCatch`, `fromEither`, `taskify`...\n\n### 3. Tiny\n\n| Library | Bundle (minified + gzip) | Dependencies |\n|---------|------------------------:|:------------:|\n| **ts-safe** | **~1 KB** | **0** |\n| neverthrow | ~2 KB | 0 |\n| fp-ts | ~30 KB | 0 |\n| Effect | ~50 KB+ | multiple |\n\n## Install\n\n```bash\nnpm install ts-safe\n```\n\n## Quick Start\n\n```ts\nimport { safe } from 'ts-safe';\n\n// Wrap a value\nsafe(42)                        // Safe<number>\n\n// Wrap a function — errors are captured, not thrown\nsafe(() => JSON.parse(input))   // Safe<any>\n\n// Chain operations\nsafe(() => riskyOperation())\n  .map(value => transform(value))       // transform the value\n  .ifOk(value => sideEffect(value))         // side effect — errors break the chain\n  .observeOk(value => console.log(value))  // observe — errors are ignored\n  .recover(err => fallbackValue)        // recover from error\n  .unwrap()                             // extract the result\n```\n\n## API\n\nMethods are organized by **impact on the chain**:\n\n```\n┌──────────────────────────────────────────────────────────────┐\n│                                                              │\n│  Transform        map(fn)       value → new value            │\n│  (changes value)  flatMap(fn)   value → Safe → flatten       │\n│                                                              │\n│  Side Effect      ifOk(fn)      run on success, keep value   │\n│  (can break)      ifFail(fn)    run on error, keep error     │\n│                   recover(fn)   run on error, provide value  │\n│                   effect(fn)    deprecated alias for ifOk    │\n│                                                              │\n│  Observe          observe(fn)      see SafeResult, can't break  │\n│  (can't break)    observeOk(fn)    see value only, can't break  │\n│                   observeError(fn) see error only, can't break  │\n│                                                              │\n│  Extract          unwrap()      get value or throw           │\n│                   orElse(v)     get value or default          │\n│                   match({ok,err}) pattern match              │\n│                   isOk          boolean (or Promise<boolean>) │\n│                                                              │\n└──────────────────────────────────────────────────────────────┘\n```\n\n### `map(fn)` — Transform\n\nChanges the value. Skipped on error.\n\n```ts\nsafe(2).map(x => x * 3).unwrap() // 6\n```\n\n### `flatMap(fn)` — Transform with Safe\n\nLike `map`, but for functions that return another `Safe`. Flattens the result.\n\n```ts\nconst parse = (s: string) => safe(() => JSON.parse(s));\nsafe('{\"a\":1}').flatMap(parse).unwrap() // { a: 1 }\n```\n\n### `ifOk(fn)` — Side Effect on Success\n\nRuns a function on success. The **original value is preserved** (return value ignored). If the function **throws, the error propagates**. If it returns a Promise, the chain becomes async.\n\n> `effect(fn)` is a deprecated alias for `ifOk`.\n\n```ts\nsafe(user)\n  .ifOk(u => saveToDb(u))      // if throws → error state\n  .ifOk(u => sendEmail(u))     // skipped if above threw\n  .map(u => u.name)\n  .unwrap()\n```\n\n### `ifFail(fn)` — Side Effect on Failure\n\nMirror of `ifOk` for the error channel. Runs a function on failure. The **original error is preserved** (return value ignored). If the callback **throws, that error replaces the original**. If it returns a Promise, the chain becomes async.\n\nUse when you want to react to a failure (report it, log it) without recovering and want the callback's own failures to be visible. Compare with `observeError`, which swallows callback errors silently.\n\n```ts\nsafe(() => fetchUser())\n  .ifFail(err => reportToSentry(err))  // if Sentry throws, that error replaces the original\n  .recover(() => defaultUser)          // chain is still error after ifFail\n  .unwrap()\n```\n\n### `recover(fn)` — Error Recovery\n\nProvides a replacement value on error. After recovery, the chain continues as success.\n\n```ts\nsafe(() => { throw new Error('fail') })\n  .recover(err => 'default')   // chain is now ok\n  .map(v => v.toUpperCase())\n  .unwrap()                     // 'DEFAULT'\n```\n\n### `observe(fn)` / `observeOk(fn)` / `observeError(fn)` — Observe\n\nPure observation. **Nothing you do inside can affect the chain** — thrown errors are silently ignored, Promises are silently ignored, return values are ignored. The chain passes through completely unchanged.\n\nUse for logging, metrics, debugging — anything where failure shouldn't stop the flow.\n\n```ts\nsafe(result)\n  .observeOk(v => console.log('success:', v))    // only on success\n  .observeError(e => console.error('error:', e))  // only on error\n  .observe(r => metrics.record(r.isOk))           // always runs\n  .unwrap()\n```\n\nThe difference from `ifOk` / `ifFail`: if your logging service throws, those would break the chain. `observe` swallows the error and continues.\n\n```ts\n// ifOk — error propagates (for important side effects)\nsafe(data).ifOk(d => saveToDb(d))         // DB failure → chain breaks ✓\n\n// observeOk — error ignored (for optional side effects)\nsafe(data).observeOk(d => analytics(d))   // analytics failure → chain continues ✓\n```\n\n### `match({ ok, err })` — Pattern Match\n\nHandles both success and error explicitly. Returns the handler's result.\n\n```ts\nconst message = safe(() => fetchUser())\n  .map(user => user.name)\n  .match({\n    ok:  name  => `Hello, ${name}!`,\n    err: error => `Failed: ${error.message}`\n  });\n```\n\n### `unwrap()` / `orElse(fallback)` — Extract\n\n```ts\nsafe(42).unwrap()                                     // 42\nsafe(() => { throw new Error() }).unwrap()            // throws!\n\nsafe(42).orElse('default')                            // 42\nsafe(() => { throw new Error() }).orElse('default')   // 'default' (never throws)\n```\n\n### `isOk` — Check State\n\n```ts\nsafe(42).isOk                              // true\nsafe(() => { throw new Error() }).isOk     // false\nawait safe(1).map(async x => x).isOk       // Promise<true>\n```\n\n## Promise Inference\n\nThis is the core differentiator. ts-safe tracks sync/async state **at the type level** without any extra syntax.\n\n### How it works\n\n| What you do | Chain type | Why |\n|---|---|---|\n| `safe(42)` | `Safe<number>` | Sync value |\n| `.map(x => x + 1)` | `Safe<number>` | Sync callback → stays sync |\n| `.map(async x => fetch(x))` | `Safe<Promise<Response>>` | Async callback → becomes async |\n| `.map(res => res.json())` | `Safe<Promise<any>>` | Callback receives awaited value |\n| `.ifOk(async x => log(x))` | `Safe<Promise<T>>` | Async side effect → becomes async |\n| `.observe(async x => log(x))` | `Safe<T>` | observe **never** goes async |\n\n### The key rule\n\n> When the chain is async, callbacks receive the **awaited** value — not the Promise.\n\n```ts\nsafe(1)\n  .map(async x => x + 1)     // callback returns Promise<number>\n  .map(x => x * 10)           // x is number (not Promise<number>)\n  .unwrap()                    // Promise<number>\n```\n\nYou write synchronous-looking transforms. ts-safe handles the awaiting.\n\n### Comparison with alternatives\n\n```ts\n// neverthrow — need separate ResultAsync + awkward wrapping\nconst result = ResultAsync.fromPromise(fetch('/api'), handleErr)\n  .andThen(res => ResultAsync.fromPromise(res.json(), handleErr))\n  .map(data => data.name);\n\n// ts-safe — just write it\nconst result = safe(() => fetch('/api'))\n  .map(res => res.json())\n  .map(data => data.name);\n```\n\n## Utilities\n\n### Validation\n\nValidator functions for use with `map`. They return the value if valid, or throw if not.\n\n```ts\nimport { safe, errorIfNull, errorIfEmpty, errorIf } from 'ts-safe';\n\nsafe(userInput)\n  .map(errorIfNull('Input required'))\n  .map(errorIfEmpty('Must not be empty'))\n  .map(errorIf(v => v.length < 3 ? 'Too short' : false))\n  .unwrap()\n```\n\n| Function | Throws when |\n|---|---|\n| `errorIfNull(msg?)` | `null` or `undefined` |\n| `errorIfFalsy(msg?)` | any falsy value |\n| `errorIfEmpty(msg?)` | `.length === 0` |\n| `errorIf(predicate)` | predicate returns a string |\n\n### Retry\n\nAutomatic retry with optional exponential backoff:\n\n```ts\nimport { safe, retry } from 'ts-safe';\n\nawait safe(url)\n  .map(retry(fetchData, {\n    maxTries: 3,    // default: 3\n    delay: 1000,    // default: 1000ms\n    backoff: true   // exponential: 1s, 2s, 4s\n  }))\n  .unwrap();\n```\n\n### Pipe\n\nCompose functions into a reusable pipeline with automatic error handling:\n\n```ts\nconst getUsername = safe.pipe(\n  (id: number) => fetchUser(id),  // number → User\n  user => user.name,               // User → string\n  name => name.toUpperCase()       // string → string\n);\n\ngetUsername(1).unwrap()    // 'ALICE'\ngetUsername(999).orElse('ANONYMOUS')\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}