@safejs/serializer
Version:
Serializer is a superset of JSON that includes recursive objects, dates, regular expressions, functions and others which you also can expand by yourself
13 lines • 409 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapSerializer = void 0;
exports.mapSerializer = {
determine: (v) => v instanceof Map,
serialize: (v) => Array.from(v),
deserialize: () => new Map(),
initialize: (obj, v) => {
if (Array.isArray(v))
v.forEach(([k, v]) => obj.set(k, v));
},
};
//# sourceMappingURL=map.js.map
;