bs-sentia-std
Advanced tools
Comparing version 8.0.0 to 9.0.0
@@ -1538,3 +1538,3 @@ // Generated by BUCKLESCRIPT VERSION 1.9.0, PLEASE EDIT WITH CARE | ||
function decode$1(decoder, json) { | ||
function decodeJSON(decoder, json) { | ||
try { | ||
@@ -1545,6 +1545,18 @@ return /* Ok */Block.__(1, [Curry._1(decoder, json)]); | ||
var exn = Js_exn.internalToOCamlException(raw_exn); | ||
if (exn[0] === Json_decode.DecodeError) { | ||
return /* Error */Block.__(0, [exn[1]]); | ||
} else { | ||
throw exn; | ||
} | ||
} | ||
} | ||
function parseJSON(jsonString) { | ||
try { | ||
return /* Ok */Block.__(1, [JSON.parse(jsonString)]); | ||
} | ||
catch (raw_exn){ | ||
var exn = Js_exn.internalToOCamlException(raw_exn); | ||
if (exn[0] === Js_exn.$$Error) { | ||
return /* Error */Block.__(0, [withDefault("Could not parse JSON", Js_primitive.undefined_to_opt(exn[1].message))]); | ||
} else if (exn[0] === Json_decode.DecodeError) { | ||
return /* Error */Block.__(0, [exn[1]]); | ||
} else { | ||
@@ -1701,3 +1713,4 @@ throw exn; | ||
exports.Option = Option; | ||
exports.decode = decode$1; | ||
exports.decodeJSON = decodeJSON; | ||
exports.parseJSON = parseJSON; | ||
/* Js_dict Not a pure module */ |
{ | ||
"name": "bs-sentia-std", | ||
"version": "8.0.0", | ||
"version": "9.0.0", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "clean": "bsb -clean-world", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
90900
2912