mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 14:27:04 +00:00
Add [@strikeentco/get] type declarations (#38039)
* [@strikeentco/get] Added types for strikeentco's get * [@strikeentco/get] Fixed common mistake array -> ReadonlyArray
This commit is contained in:
committed by
Andrew Casey
parent
71ce6eca63
commit
444fa06fdf
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// Type definitions for @strikeentco/get 1.0
|
||||
// Project: https://github.com/strikeentco/get
|
||||
// Definitions by: Elliott Campbell <https://github.com/ElliottCampbellJHA>
|
||||
// Erik Heikes <https://github.com/eheikes>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
declare function get(obj: object, paths: string | ReadonlyArray<string>, separator?: string): any;
|
||||
export = get;
|
||||
@@ -0,0 +1,7 @@
|
||||
import get = require('@strikeentco/get');
|
||||
|
||||
get({ a: { b: 'c' } }, 'a.b');
|
||||
get({ a: { b: ['c', 'd'] } }, 'a.b.1');
|
||||
get({ a: { b: ['c', 'd'] } }, ['a', 'b']);
|
||||
get({ a: { b: 'c' } }, 'a.b.c.d');
|
||||
get({ a: { b: 'c' } }, 'a:b', ':');
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"paths": {
|
||||
"@strikeentco/get": ["strikeentco__get"]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"strikeentco__get-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user