UNPKG

@linkedmink/multilevel-aging-cache

Version:

Package provides an interface to cache and persist data to Redis, MongoDB, memory

20 lines (19 loc) 510 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.JsonSerializer = void 0; const serialize = (data) => { return JSON.stringify(data); }; const deserialize = (data) => { return JSON.parse(data); }; /** * De/Serialize JSON objects with the native JSON.stringify and JSON.parse */ class JsonSerializer { constructor() { this.serialize = serialize; this.deserialize = deserialize; } } exports.JsonSerializer = JsonSerializer;