From 61b5651f248b7dec79f4434af31fa12f6df12c04 Mon Sep 17 00:00:00 2001 From: Boris Cherny Date: Mon, 10 Jul 2017 16:19:35 -0700 Subject: [PATCH] clean up _.sample typings --- types/lodash/index.d.ts | 42 ++++++++++++------------------------ types/lodash/lodash-tests.ts | 2 +- 2 files changed, 15 insertions(+), 29 deletions(-) diff --git a/types/lodash/index.d.ts b/types/lodash/index.d.ts index 172000d6b8..83e7b2ff86 100644 --- a/types/lodash/index.d.ts +++ b/types/lodash/index.d.ts @@ -385,13 +385,13 @@ declare namespace _ { interface LoDashImplicitObjectWrapperBase extends LoDashImplicitWrapperBase { } interface LoDashImplicitObjectWrapper extends LoDashImplicitObjectWrapperBase> { } - + interface LoDashImplicitNillableObjectWrapper extends LoDashImplicitObjectWrapperBase> { } interface LoDashExplicitObjectWrapperBase extends LoDashExplicitWrapperBase { } interface LoDashExplicitObjectWrapper extends LoDashExplicitObjectWrapperBase> { } - + interface LoDashExplicitNillableObjectWrapper extends LoDashExplicitObjectWrapperBase> { } interface LoDashImplicitArrayWrapperBase extends LoDashImplicitWrapperBase { @@ -6013,7 +6013,7 @@ declare namespace _ { * @see _.plant */ plant(value: T[]): LoDashImplicitArrayWrapper; - + /** * @see _.plant */ @@ -6055,7 +6055,7 @@ declare namespace _ { * @see _.plant */ plant(value: T[]): LoDashExplicitArrayWrapper; - + /** * @see _.plant */ @@ -6566,7 +6566,7 @@ declare namespace _ { collection: string | null | undefined, iteratee?: ListIterator ): string | null | undefined; - + /** * @see _.forEachRight */ @@ -7568,7 +7568,7 @@ declare namespace _ { collection: T, iteratee?: ObjectIterator ): T; - + /** * @see _.forEach */ @@ -9232,21 +9232,7 @@ declare namespace _ { * @return Returns the random element. */ sample( - collection: List|Dictionary|NumericDictionary | null | undefined - ): T | undefined; - - /** - * @see _.sample - */ - sample( - collection: O | null | undefined - ): T | undefined; - - /** - * @see _.sample - */ - sample( - collection: Object | null | undefined + collection: List | Dictionary | NumericDictionary | object | null | undefined ): T | undefined; } @@ -12085,17 +12071,17 @@ declare namespace _ { * // => false */ isArrayLike(value: T & string & number): boolean; // should only match if T = any - + /** * @see _.isArrayLike */ isArrayLike(value?: Function): value is never; - + /** * @see _.isArrayLike */ isArrayLike(value: T | Function): value is T & { length: number }; - + /** * DEPRECATED */ @@ -12143,17 +12129,17 @@ declare namespace _ { * // => false */ isArrayLikeObject(value: T & string & number): boolean; // should only match if T = any - + /** * @see _.isArrayLike */ isArrayLikeObject(value?: Function | string | boolean | number): value is never; - + /** * @see _.isArrayLike */ isArrayLikeObject(value: T | Function | string | boolean | number): value is T & { length: number }; - + /** * DEPRECATED */ @@ -14016,7 +14002,7 @@ declare namespace _ { * @see _.multiply */ multiply(multiplicand: number): LoDashExplicitWrapper; - } + } //_.round interface LoDashStatic { diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index 4721e9381d..8b8a27e97a 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -5118,7 +5118,7 @@ namespace TestSample { result = _.sample(list); result = _.sample(dictionary); result = _.sample(numericDictionary); - result = _.sample<{a: string}, string>({a: 'foo'}); + result = _.sample({a: 'foo'}); result = _.sample({a: 'foo'}); result = _('abc').sample();