Skip to content

Commit 158cfd1

Browse files
committed
Add type definitions
1 parent 47dd7ff commit 158cfd1

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

json-truncate.d.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export type Options = {
2+
/** The max depth to build. */
3+
maxDepth?: number;
4+
/** What to replace the truncated reference to. */
5+
replace?: unknown;
6+
curDepth?: number;
7+
};
8+
9+
/**
10+
* Truncates variables.
11+
* @param obj The object to truncate.
12+
* @param options If a number, the maxDepth, otherwise configurable options.
13+
* @returns The truncated object.
14+
*/
15+
declare function truncate<T>(obj: T, options?: Options | number): T;
16+
17+
export default truncate;

0 commit comments

Comments
 (0)