result.js 265 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 var Result = require('rust-result'); module.exports = SafeParseTuple function SafeParseTuple(obj, reviver) { var json try { json = JSON.parse(obj, reviver); } catch (err) { return Result.Err(err); } return Result.Ok(json); }