resulty
v6.2.0
Published
A return type for computations that may fail
Downloads
4,445
Readme
resulty
A disjunction implementation in TypeScript.
install
npm install --save resulty
yarn add resulty
usage
import { ok, err } from 'resulty';
function parse(s) {
try {
return ok(JSON.parse(s));
}
catch(e) {
return err(e.message);
}
}