UNPKG

get-json-val

Version:

At the same time, it is a function to judge whether it is a JSON string and the result of parsing the JSON string.

3 lines (2 loc) 325 B
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(e){if(!e||"string"!=typeof e)return[new Error("value must be a string"),null];var r=null,t=null;try{r=JSON.parse(e)}catch(e){t=e}return[t,r]};exports.default=e,exports.getJSONVal=e; //# sourceMappingURL=get-json-val.cjs.production.min.js.map