diff --git a/json-truncate.d.ts b/json-truncate.d.ts new file mode 100644 index 0000000..1999858 --- /dev/null +++ b/json-truncate.d.ts @@ -0,0 +1,17 @@ +export type Options = { + /** The max depth to build. */ + maxDepth?: number; + /** What to replace the truncated reference to. */ + replace?: unknown; + curDepth?: number; +}; + +/** + * Truncates variables. + * @param obj The object to truncate. + * @param options If a number, the maxDepth, otherwise configurable options. + * @returns The truncated object. + */ +declare function truncate(obj: T, options?: Options | number): T; + +export default truncate;