mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
feat: add types for object.pick
This commit is contained in:
parent
6a5529e838
commit
fb65ca2f8e
15
types/object.pick/index.d.ts
vendored
Normal file
15
types/object.pick/index.d.ts
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
// Type definitions for object.pick 1.3
|
||||
// Project: https://github.com/jonschlinkert/object.pick
|
||||
// Definitions by: Ifiok Jr. <https://github.com/ifiokjr>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
/**
|
||||
* Returns a filtered copy of an object with only the specified keys, similar to `_.pick` from lodash / underscore.
|
||||
*
|
||||
* @param object
|
||||
* @param keys
|
||||
*/
|
||||
declare function pick<T extends object, U extends keyof T>(object: T, keys: U[]): Pick<T, U>;
|
||||
|
||||
export = pick;
|
||||
3
types/object.pick/object.pick-tests.ts
Normal file
3
types/object.pick/object.pick-tests.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import pick = require('object.pick');
|
||||
|
||||
pick({a: 'a', b: 'b'}, ['a']);
|
||||
23
types/object.pick/tsconfig.json
Normal file
23
types/object.pick/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"strictFunctionTypes": true,
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"object.pick-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/object.pick/tslint.json
Normal file
1
types/object.pick/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user