@a11ywatch/core
Version:
a11ywatch central API
21 lines • 540 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.jsonParse = void 0;
const pb_util_1 = require("pb-util");
const jsonParse = (json) => {
let jsonData;
try {
if (typeof json === "string") {
jsonData = JSON.parse(json);
}
else if ("fields" in json) {
jsonData = pb_util_1.struct.decode(json);
}
}
catch (e) {
console.error(e);
}
return jsonData;
};
exports.jsonParse = jsonParse;
//# sourceMappingURL=json-parse.js.map
;