UNPKG

@a11ywatch/core

Version:
21 lines 540 B
"use strict"; 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