UNPKG

@rickyli79/rich-json

Version:

Serialize and Deserialize javascript objects

24 lines (23 loc) 694 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SetSerializer = void 0; const lib_1 = require("../lib"); class SetSerializer { static instance; static getInstance() { if (this.instance === undefined) { this.instance = (0, lib_1.createCustomerSerializer)({ class: Set, toContent(value) { return Array.from(value); }, fromContent(content) { return new Set(content); }, serializContent: true, }); } return this.instance; } } exports.SetSerializer = SetSerializer;