UNPKG

@triviality/serializer

Version:
20 lines 685 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var JSONSerializer = /** @class */ (function () { function JSONSerializer(beautify) { if (beautify === void 0) { beautify = true; } this.beautify = beautify; } JSONSerializer.prototype.deserialize = function (serialized) { return JSON.parse(serialized); }; JSONSerializer.prototype.serialize = function (data) { if (this.beautify) { return JSON.stringify(data, null, ' '); } return JSON.stringify(data); }; return JSONSerializer; }()); exports.JSONSerializer = JSONSerializer; //# sourceMappingURL=JSONSerializer.js.map