UNPKG

ejson2

Version:
18 lines 622 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.stringify = void 0; const utils_1 = require("../utils"); const index_1 = require("./index"); const stringify_1 = require("../stringify"); exports.stringify = (0, utils_1.handleError)((item, options) => { let serialized; const json = index_1.EJSON.toJSONValue(item); if (options && (options.canonical || options.indent)) { serialized = (0, stringify_1.canonicalStringify)(json, options); } else { serialized = JSON.stringify(json); } return serialized; }); //# sourceMappingURL=stringify.js.map