From 75263ecd6a261f63f831ccced19e6cc041f957e2 Mon Sep 17 00:00:00 2001 From: kirjahylly Date: Mon, 17 Jun 2019 18:00:39 +0100 Subject: [PATCH] Fix underscore path param types. (#35999) * Fix underscore path param types. * Add test * Replace all occurrences of type Object with object in Underscore types --- types/underscore/index.d.ts | 14 +++++++------- types/underscore/underscore-tests.ts | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/types/underscore/index.d.ts b/types/underscore/index.d.ts index c23f96f8ab..f8f77584e4 100644 --- a/types/underscore/index.d.ts +++ b/types/underscore/index.d.ts @@ -3765,7 +3765,7 @@ declare module _ { * @param prototype The prototype that the returned object will inherit from. * @param props Additional props added to the returned object. **/ - create(prototype: any, props?: Object): any; + create(prototype: any, props?: object): any; /** * Create a shallow-copied clone of the object. @@ -3813,14 +3813,14 @@ declare module _ { * @param key Property of the object. * @return Function which accept an object an returns the value of key in that object. **/ - property(key: string | string[]): (object: Object) => any; + property(key: string | number | Array): (object: object) => any; /** * Returns a function that will itself return the value of a object key property. * @param key The object to get the property value from. * @return Function which accept a key property in `object` and returns its value. **/ - propertyOf(object: Object): (key: string | string[]) => any; + propertyOf(object: object): (key: string | number | Array) => any; /** * Performs an optimized deep comparison between the two objects, @@ -4044,7 +4044,7 @@ declare module _ { **/ iteratee(value: string): Function; iteratee(value: Function, context?: any): Function; - iteratee(value: Object): Function; + iteratee(value: object): Function; /** * Generate a globally-unique id for client-side models or DOM elements that need one. @@ -4811,7 +4811,7 @@ declare module _ { * Wrapped type `any`. * @see _.create **/ - create(props?: Object): any; + create(props?: object): any; /** * Wrapped type `any[]`. @@ -4847,7 +4847,7 @@ declare module _ { * Wrapped type `string`. * @see _.property **/ - property(): (object: Object) => any; + property(): (object: object) => any; /** * Wrapped type `object`. @@ -5777,7 +5777,7 @@ declare module _ { * Wrapped type `any`. * @see _.create **/ - create(props?: Object): _Chain; + create(props?: object): _Chain; /** * Wrapped type `any[]`. diff --git a/types/underscore/underscore-tests.ts b/types/underscore/underscore-tests.ts index 564802c780..66561d4e38 100644 --- a/types/underscore/underscore-tests.ts +++ b/types/underscore/underscore-tests.ts @@ -394,7 +394,7 @@ _.isObject(1); _.property('name')(moe); _.property(['name'])(moe); - +_.property(['luckyNumbers', 2])(moe) // (() => { return _.isArguments(arguments); })(1, 2, 3); _.isArguments([1, 2, 3]);