UNPKG

@tsed/json-mapper

Version:
21 lines (20 loc) 471 B
import { __decorate } from "tslib"; import { JsonMapper } from "../decorators/jsonMapper.js"; /** * Mapper for the `Symbol` type. * * @jsonmapper * @component */ let SymbolMapper = class SymbolMapper { deserialize(data) { return Symbol.for(data); } serialize(object) { return object.toString().replace("Symbol(", "").replace(")", ""); } }; SymbolMapper = __decorate([ JsonMapper(Symbol) ], SymbolMapper); export { SymbolMapper };