From e809175e0cb86f04a1227ee16d12b657846bbded Mon Sep 17 00:00:00 2001 From: Mallen Date: Thu, 28 Mar 2019 12:30:43 -0400 Subject: [PATCH] Fix get-value second argument typing not accepting arrays (#34244) --- types/get-value/get-value-tests.ts | 3 +++ types/get-value/index.d.ts | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/types/get-value/get-value-tests.ts b/types/get-value/get-value-tests.ts index 9e7534e000..c6cf6c7de4 100644 --- a/types/get-value/get-value-tests.ts +++ b/types/get-value/get-value-tests.ts @@ -6,6 +6,9 @@ get(obj, "a"); get(obj, "a.b"); get(obj, "a.b.c"); get(obj, "a.b.c.d"); +get(obj, ['a']); +get(obj, ['a', 'b', 'c']); +get(obj, ['a', 'b', 'c', 'd']); { const isEnumerable = Object.prototype.propertyIsEnumerable; diff --git a/types/get-value/index.d.ts b/types/get-value/index.d.ts index 70cf0286e7..04dabe5101 100644 --- a/types/get-value/index.d.ts +++ b/types/get-value/index.d.ts @@ -1,13 +1,14 @@ // Type definitions for get-value 3.0 // Project: https://github.com/jonschlinkert/get-value // Definitions by: Daniel Rosenwasser +// Mathew Allen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 export = get; declare function get(obj: T): T; -declare function get(obj: object, key: string, options?: get.Options): any; +declare function get(obj: object, key: string | string[], options?: get.Options): any; declare namespace get { interface Options {