A disjunction implementation in TypeScript.
npm install --save resulty
yarn add resulty
import { ok, err } from 'resulty';
function parse(s) {
try {
return ok(JSON.parse(s));
}
catch(e) {
return err(e.message);
}
}
A return type for computations that may fail
Homepage Repository npm TypeScript Download
npm install resulty@6.2.0
A disjunction implementation in TypeScript.
npm install --save resulty
yarn add resulty
import { ok, err } from 'resulty';
function parse(s) {
try {
return ok(JSON.parse(s));
}
catch(e) {
return err(e.message);
}
}
The Tidelift Subscription provides access to a continuously curated stream of human-researched and maintainer-verified data on open source packages and their licenses, releases, vulnerabilities, and development practices.
Learn more →Something wrong with this page? Make a suggestion
Export .ABOUT file for this package
Last synced: 2024-04-04 23:25:17 UTC
Login to resync this project