Const
Default serializers included with the JsonAdapter. Provides built-in support for Date, Set, Map, RegExp, and BigInt types.
This array is frozen (immutable). To extend it with your own serializers, spread it into a new array:
import { defaultSerializers, ISerializer } from 'node-json-db';const mySerializer: ISerializer = { type: "MyType", serialize: (value) => value.toJSON(), deserialize: (value) => MyType.fromJSON(value), test: (value) => value instanceof MyType,};// Use with Config.addSerializer() or spread into a custom list:const serializers = [...defaultSerializers, mySerializer]; Copy
import { defaultSerializers, ISerializer } from 'node-json-db';const mySerializer: ISerializer = { type: "MyType", serialize: (value) => value.toJSON(), deserialize: (value) => MyType.fromJSON(value), test: (value) => value instanceof MyType,};// Use with Config.addSerializer() or spread into a custom list:const serializers = [...defaultSerializers, mySerializer];
Default serializers included with the JsonAdapter. Provides built-in support for Date, Set, Map, RegExp, and BigInt types.
This array is frozen (immutable). To extend it with your own serializers, spread it into a new array: