DefinitelyTyped/types/object-inspect/index.d.ts
Charles Samborski 63c0b20f2c
Add types for object-inspect@1.4
This commit add type declarations for `object-inspect`.

Related:
- https://github.com/substack/object-inspect/pull/17
2017-11-12 00:41:24 +01:00

28 lines
782 B
TypeScript

// Type definitions for object-inspect 1.4
// Project: https://github.com/substack/object-inspect
// Definitions by: Charles Samborski <https://github.com/demurgos>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace objectInspect {
/**
* Inspection options
*/
interface Options {
/**
* Maximum depth of the inspection. Default: `5`.
*/
depth?: number;
}
}
/**
* Return a string `s` with the string representation of `obj` up to a depth of `opts.depth`.
*
* @param obj Object to inspect
* @param opts Inspection options. Default: `{}`.
* @return String representation of `obj`
*/
declare function objectInspect(obj: any, opts?: objectInspect.Options): string;
export = objectInspect;