UNPKG

@technobuddha/library

Version:
27 lines (26 loc) 1.02 kB
export declare const specialBegin = "\uFD3E"; export declare const specialFinish = "\uFD3F"; /** * Used with JSON.stringify to encode a wider range of objects into strings that can later be decoded with {@link revive} * * @remarks Will encode Date, RegExp and BigInt objects. The numeric values 'Infinity' and 'NaN' are also encoded. * @param this The raw object being stringified * @param key The key for the field * @param value The value (may have already been encoded into a string) * @returns the encoded value */ export declare function replacer(this: Record<string, unknown>, key: string, value: unknown): unknown; /** * Used with JSON.parse to decode objected encoded by {@link replacer} * * @param this The raw object * @param _key The key * @param value The value * @returns the decoded value */ export declare function reviver(this: unknown, _key: string, value: unknown): unknown; declare const _default: { replacer: typeof replacer; reviver: typeof reviver; }; export default _default;