From a43fa1d53dfe9920b94535ca674865b860bedf68 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 14 May 2019 13:14:45 -0700 Subject: [PATCH] Collection.values() returns T[] not ArrayLike (#35442) This is optimistic, but usually right. --- types/lodash/ts3.1/common/common.d.ts | 6 ++---- types/lodash/ts3.1/lodash-tests.ts | 18 +++++++++--------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/types/lodash/ts3.1/common/common.d.ts b/types/lodash/ts3.1/common/common.d.ts index dc892a1ca6..6b701d7f22 100644 --- a/types/lodash/ts3.1/common/common.d.ts +++ b/types/lodash/ts3.1/common/common.d.ts @@ -193,7 +193,7 @@ declare module "../index" { } interface Object extends LoDashImplicitWrapper { } - interface Collection extends LoDashImplicitWrapper> { + interface Collection extends LoDashImplicitWrapper { } interface Primitive extends LoDashImplicitWrapper { } @@ -205,9 +205,7 @@ declare module "../index" { } interface ObjectChain extends LoDashExplicitWrapper { } - interface CollectionChain extends LoDashExplicitWrapper> { - } - interface CollectionNullableChain extends LoDashExplicitWrapper | undefined> { + interface CollectionChain extends LoDashExplicitWrapper { } interface PrimitiveChain extends LoDashExplicitWrapper { } diff --git a/types/lodash/ts3.1/lodash-tests.ts b/types/lodash/ts3.1/lodash-tests.ts index d68952dabb..88d8628718 100644 --- a/types/lodash/ts3.1/lodash-tests.ts +++ b/types/lodash/ts3.1/lodash-tests.ts @@ -6011,7 +6011,7 @@ fp.now(); // $ExpectType number }); // $ExpectType Collection _([true]).tap((value) => { - value; // $ExpectType ArrayLike + value; // $ExpectType boolean[] }); // $ExpectType Object<{ a: number; }> _({ a: 42 }).tap((value) => { @@ -6024,7 +6024,7 @@ fp.now(); // $ExpectType number }); // $ExpectType CollectionChain _.chain([true]).tap((value) => { - value; // $ExpectType ArrayLike + value; // $ExpectType boolean[] }); // $ExpectType ObjectChain<{ a: number; }> _.chain({ a: 42 }).tap((value) => { @@ -6061,7 +6061,7 @@ fp.now(); // $ExpectType number }); // $ExpectType Primitive _([true]).thru((value) => { - value; // $ExpectType ArrayLike + value; // $ExpectType boolean[] return 1; }); // $ExpectType Primitive @@ -6077,7 +6077,7 @@ fp.now(); // $ExpectType number }); // $ExpectType PrimitiveChain _.chain([true]).thru((value) => { - value; // $ExpectType ArrayLike + value; // $ExpectType boolean[] return 1; }); // $ExpectType PrimitiveChain @@ -6173,13 +6173,13 @@ fp.now(); // $ExpectType number // _.prototype.toJSON { _("").value(); // $ExpectType string - _([true]).value(); // $ExpectType ArrayLike + _([true]).value(); // $ExpectType boolean[] _({ a: 42 }).value(); // $ExpectType { a: number; } _({ a: 42 }).valueOf(); // $ExpectType { a: number; } _({ a: 42 }).toJSON(); // $ExpectType { a: number; } _.chain("").value(); // $ExpectType string - _.chain([true]).value(); // $ExpectType ArrayLike + _.chain([true]).value(); // $ExpectType boolean[] _.chain({ a: 42 }).value(); // $ExpectType { a: number; } _.chain({ a: 42 }).valueOf(); // $ExpectType { a: number; } _.chain({ a: 42 }).toJSON(); // $ExpectType { a: number; } @@ -6599,12 +6599,12 @@ fp.now(); // $ExpectType number _(42).constant(); // $ExpectType Function<() => number> _("a").constant(); // $ExpectType Function<() => string> - _([true]).constant(); // $ExpectType Function<() => ArrayLike> + _([true]).constant(); // $ExpectType Function<() => boolean[]> _({ a: "" }).constant(); // $ExpectType Function<() => { a: string; }> _.chain(42).constant(); // $ExpectType FunctionChain<() => number> _.chain("a").constant(); // $ExpectType FunctionChain<() => string> - _.chain([true]).constant(); // $ExpectType FunctionChain<() => ArrayLike> + _.chain([true]).constant(); // $ExpectType FunctionChain<() => boolean[]> _.chain({ a: "" }).constant(); // $ExpectType FunctionChain<() => { a: string; }> fp.constant(42); // $ExpectType () => number @@ -6656,7 +6656,7 @@ fp.now(); // $ExpectType number _.identity([""]); // $ExpectType string[] _.identity({ a: true }); // $ExpectType { a: boolean; } _(42).identity(); // $ExpectType number - _([""]).identity(); // $ExpectType ArrayLike + _([""]).identity(); // $ExpectType string[] _({ a: true }).identity(); // $ExpectType { a: boolean; } _.chain(42).identity(); // $ExpectType PrimitiveChain _.chain([""]).identity(); // $ExpectType CollectionChain