@backtrace/sdk-core
Version:
Backtrace-JavaScript SDK core library
13 lines (12 loc) • 563 B
TypeScript
type JsonReplacer = (this: unknown, key: string, value: unknown) => unknown;
/**
* Calculates size of the object as it would be serialized into JSON.
*
* _Should_ return the same value as `JSON.stringify(value, replacer).length`.
* This may not be 100% accurate, but should work for our requirements.
* @param value Value to compute length for.
* @param replacer A function that transforms the results as in `JSON.stringify`.
* @returns Final string length.
*/
export declare function jsonSize(value: unknown, replacer?: JsonReplacer): number;
export {};