UNPKG

1.6 kBTypeScriptView Raw
1/**
2 * Recursively normalizes the given object.
3 *
4 * - Creates a copy to prevent original input mutation
5 * - Skips non-enumerable properties
6 * - When stringifying, calls `toJSON` if implemented
7 * - Removes circular references
8 * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format
9 * - Translates known global objects/classes to a string representations
10 * - Takes care of `Error` object serialization
11 * - Optionally limits depth of final output
12 * - Optionally limits number of properties/elements included in any single object/array
13 *
14 * @param input The object to be normalized.
15 * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.)
16 * @param maxProperties The max number of elements or properties to be included in any single array or
17 * object in the normallized output.
18 * @returns A normalized version of the object, or `"**non-serializable**"` if any errors are thrown during normalization.
19 */
20export declare function normalize(input: unknown, depth?: number, maxProperties?: number): any;
21/** JSDoc */
22export declare function normalizeToSize<T>(object: {
23 [key: string]: any;
24}, depth?: number, maxSize?: number): T;
25/**
26 * Normalizes URLs in exceptions and stacktraces to a base path so Sentry can fingerprint
27 * across platforms and working directory.
28 *
29 * @param url The URL to be normalized.
30 * @param basePath The application base path.
31 * @returns The normalized URL.
32 */
33export declare function normalizeUrlToBase(url: string, basePath: string): string;
34//# sourceMappingURL=normalize.d.ts.map
\No newline at end of file