From 2194a1ac8b3e83a882b07257a8dfdc94b5fe2b72 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Fri, 10 May 2019 11:02:34 -0700 Subject: [PATCH] fix lodash's Collection.groupBy return type (#35347) * fix lodash's Collection.groupBy return type should be ```ts Object> // not Object> ``` * Fix String and update tests --- types/lodash/ts3.1/common/collection.d.ts | 8 ++++---- types/lodash/ts3.1/lodash-tests.ts | 24 +++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/types/lodash/ts3.1/common/collection.d.ts b/types/lodash/ts3.1/common/collection.d.ts index 0f782e45c2..693afe54fd 100644 --- a/types/lodash/ts3.1/common/collection.d.ts +++ b/types/lodash/ts3.1/common/collection.d.ts @@ -956,13 +956,13 @@ declare module "../index" { /** * @see _.groupBy */ - groupBy(iteratee?: ValueIteratee): Object>; + groupBy(iteratee?: ValueIteratee): Object>; } interface Collection { /** * @see _.groupBy */ - groupBy(iteratee?: ValueIteratee): Object>; + groupBy(iteratee?: ValueIteratee): Object>; } interface Object { /** @@ -974,7 +974,7 @@ declare module "../index" { /** * @see _.groupBy */ - groupBy(iteratee?: ValueIteratee): ObjectChain>; + groupBy(iteratee?: ValueIteratee): ObjectChain>; } interface StringNullableChain { /** @@ -986,7 +986,7 @@ declare module "../index" { /** * @see _.groupBy */ - groupBy(iteratee?: ValueIteratee): ObjectChain>; + groupBy(iteratee?: ValueIteratee): ObjectChain>; } interface ObjectChain { /** diff --git a/types/lodash/ts3.1/lodash-tests.ts b/types/lodash/ts3.1/lodash-tests.ts index 317a2a6de4..68167331d4 100644 --- a/types/lodash/ts3.1/lodash-tests.ts +++ b/types/lodash/ts3.1/lodash-tests.ts @@ -2480,23 +2480,23 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType CollectionChain _.groupBy(dictionary, ""); // $ExpectType Dictionary _.groupBy(dictionary, { a: 42 }); // $ExpectType Dictionary - _("").groupBy(); // $ExpectType Object> - _("").groupBy(stringIterator); // $ExpectType Object> - _(list).groupBy(); // $ExpectType Object> - _(list).groupBy(valueIterator); // $ExpectType Object> - _(list).groupBy(""); // $ExpectType Object> - _(list).groupBy({ a: 42 }); // $ExpectType Object> + _("").groupBy(); // $ExpectType Object> + _("").groupBy(stringIterator); // $ExpectType Object> + _(list).groupBy(); // $ExpectType Object> + _(list).groupBy(valueIterator); // $ExpectType Object> + _(list).groupBy(""); // $ExpectType Object> + _(list).groupBy({ a: 42 }); // $ExpectType Object> _(dictionary).groupBy(); // $ExpectType Object> _(dictionary).groupBy(valueIterator); // $ExpectType Object> _(dictionary).groupBy(""); // $ExpectType Object> _(dictionary).groupBy({ a: 42 }); // $ExpectType Object> - _.chain("").groupBy(); // $ExpectType ObjectChain> - _.chain("").groupBy(stringIterator); // $ExpectType ObjectChain> - _.chain(list).groupBy(); // $ExpectType ObjectChain> - _.chain(list).groupBy(valueIterator); // $ExpectType ObjectChain> - _.chain(list).groupBy(""); // $ExpectType ObjectChain> - _.chain(list).groupBy({ a: 42 }); // $ExpectType ObjectChain> + _.chain("").groupBy(); // $ExpectType ObjectChain> + _.chain("").groupBy(stringIterator); // $ExpectType ObjectChain> + _.chain(list).groupBy(); // $ExpectType ObjectChain> + _.chain(list).groupBy(valueIterator); // $ExpectType ObjectChain> + _.chain(list).groupBy(""); // $ExpectType ObjectChain> + _.chain(list).groupBy({ a: 42 }); // $ExpectType ObjectChain> _.chain(dictionary).groupBy(); // $ExpectType ObjectChain> _.chain(dictionary).groupBy(valueIterator); // $ExpectType ObjectChain> _.chain(dictionary).groupBy(""); // $ExpectType ObjectChain>