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);
}
}
Generated using TypeDoc