From fb65ca2f8e46adbd733f3c07cfbcb7dc4ad21382 Mon Sep 17 00:00:00 2001 From: Ifiok Jr Date: Sun, 14 Apr 2019 11:43:41 +0100 Subject: [PATCH] feat: add types for object.pick --- types/object.pick/index.d.ts | 15 +++++++++++++++ types/object.pick/object.pick-tests.ts | 3 +++ types/object.pick/tsconfig.json | 23 +++++++++++++++++++++++ types/object.pick/tslint.json | 1 + 4 files changed, 42 insertions(+) create mode 100644 types/object.pick/index.d.ts create mode 100644 types/object.pick/object.pick-tests.ts create mode 100644 types/object.pick/tsconfig.json create mode 100644 types/object.pick/tslint.json diff --git a/types/object.pick/index.d.ts b/types/object.pick/index.d.ts new file mode 100644 index 0000000000..1476e5cd23 --- /dev/null +++ b/types/object.pick/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for object.pick 1.3 +// Project: https://github.com/jonschlinkert/object.pick +// Definitions by: Ifiok Jr. +// 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(object: T, keys: U[]): Pick; + +export = pick; diff --git a/types/object.pick/object.pick-tests.ts b/types/object.pick/object.pick-tests.ts new file mode 100644 index 0000000000..ea4aa1ed49 --- /dev/null +++ b/types/object.pick/object.pick-tests.ts @@ -0,0 +1,3 @@ +import pick = require('object.pick'); + +pick({a: 'a', b: 'b'}, ['a']); diff --git a/types/object.pick/tsconfig.json b/types/object.pick/tsconfig.json new file mode 100644 index 0000000000..fe0d649662 --- /dev/null +++ b/types/object.pick/tsconfig.json @@ -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" + ] +} diff --git a/types/object.pick/tslint.json b/types/object.pick/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/object.pick/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }