UNPKG

any-serialize

Version:

Serialize / Deserialize any JavaScript objects, as long as you provides how-to. I have already provided `Date`, `RegExp`, `Set` and `Function`.

36 lines 1.29 kB
export declare type StringifyFunction = (obj: any, ...args: any[]) => string; export declare type ParseFunction = (repr: string, reviver: (k: string, v: any) => any) => any; export interface IRegistration { item?: Function | RegExpConstructor; prefix?: string; key?: string; toJSON?: (_this: any, parent: any) => any; fromJSON?: ((current: any, parent: any) => any) | null; } export declare function isClassConstructor(k: any): k is { prototype: { constructor: any; }; }; export declare function isClassObject(k: any): k is { constructor: { name: string; }; }; export declare function compareNotFalsy(a: any, b: any): boolean; export declare function getFunctionName(R: Function): string; export declare function functionToString(R: Function): string; /** * https://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript * * https://stackoverflow.com/a/52171480/9023855 * * @param str * @param seed */ export declare function cyrb53(str: string, seed?: number): number; /** * https://stackoverflow.com/questions/34699529/convert-javascript-class-instance-to-plain-object-preserving-methods */ export declare function extractObjectFromClass(o: any, exclude?: string[]): any; //# sourceMappingURL=utils.d.ts.map