mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 13:00:19 +00:00
Merge pull request #21445 from demurgos/add-object-inspect
Add types for `object-inspect@1.4`
This commit is contained in:
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
// 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;
|
||||
@@ -0,0 +1,10 @@
|
||||
import objectInspect = require('object-inspect');
|
||||
|
||||
// $ExpectType string
|
||||
objectInspect({foo: "bar"});
|
||||
|
||||
// $ExpectType string
|
||||
objectInspect({foo: "bar"}, {});
|
||||
|
||||
// $ExpectType string
|
||||
objectInspect({foo: "bar"}, {depth: Infinity});
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"object-inspect-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user