json.js 494 B

12345678910111213
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.parseJson = void 0;
  4. const jsonc_parser_1 = require("jsonc-parser");
  5. const preprocess_1 = require("../preprocess");
  6. function parseJson(jsonStr, shouldPre = false) {
  7. return (0, jsonc_parser_1.parse)(shouldPre
  8. ? process.env.UNI_APP_X === 'true'
  9. ? (0, preprocess_1.preUVueJson)(jsonStr)
  10. : (0, preprocess_1.preJson)(jsonStr)
  11. : jsonStr);
  12. }
  13. exports.parseJson = parseJson;