UNPKG

@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

25 lines (24 loc) 607 B
import { Preset } from "./presets"; import { ExtraSerializersPreset } from "./types"; interface SerializerOptions { /** * Preset */ preset?: Preset; /** * Serialize functions */ functions?: boolean; /** * Extra serializers */ extra?: ExtraSerializersPreset; } export declare class Serializer { private serializers; constructor(options?: SerializerOptions); setOptions({ preset, functions: f, extra, }?: SerializerOptions): void; serialize(obj: any): string; deserialize<T = any>(str: string): T; } export {};