Fix get-value second argument typing not accepting arrays (#34244)

This commit is contained in:
Mallen
2019-03-28 09:30:43 -07:00
committed by Ron Buckton
parent c9040913ba
commit e809175e0c
2 changed files with 5 additions and 1 deletions
+3
View File
@@ -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;
+2 -1
View File
@@ -1,13 +1,14 @@
// Type definitions for get-value 3.0
// Project: https://github.com/jonschlinkert/get-value
// Definitions by: Daniel Rosenwasser <https://github.com/DanielRosenwasser>
// Mathew Allen <https://github.com/TheMallen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
export = get;
declare function get<T>(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 {