mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
fix lodash's Collection.groupBy return type (#35347)
* fix lodash's Collection.groupBy return type should be ```ts Object<Dictionary<T[]>> // not Object<Dictionary<T>> ``` * Fix String and update tests
This commit is contained in:
committed by
GitHub
parent
0250e5f778
commit
2194a1ac8b
8
types/lodash/ts3.1/common/collection.d.ts
vendored
8
types/lodash/ts3.1/common/collection.d.ts
vendored
@@ -956,13 +956,13 @@ declare module "../index" {
|
||||
/**
|
||||
* @see _.groupBy
|
||||
*/
|
||||
groupBy(iteratee?: ValueIteratee<string>): Object<Dictionary<string>>;
|
||||
groupBy(iteratee?: ValueIteratee<string>): Object<Dictionary<string[]>>;
|
||||
}
|
||||
interface Collection<T> {
|
||||
/**
|
||||
* @see _.groupBy
|
||||
*/
|
||||
groupBy(iteratee?: ValueIteratee<T>): Object<Dictionary<T>>;
|
||||
groupBy(iteratee?: ValueIteratee<T>): Object<Dictionary<T[]>>;
|
||||
}
|
||||
interface Object<T> {
|
||||
/**
|
||||
@@ -974,7 +974,7 @@ declare module "../index" {
|
||||
/**
|
||||
* @see _.groupBy
|
||||
*/
|
||||
groupBy(iteratee?: ValueIteratee<string>): ObjectChain<Dictionary<string>>;
|
||||
groupBy(iteratee?: ValueIteratee<string>): ObjectChain<Dictionary<string[]>>;
|
||||
}
|
||||
interface StringNullableChain {
|
||||
/**
|
||||
@@ -986,7 +986,7 @@ declare module "../index" {
|
||||
/**
|
||||
* @see _.groupBy
|
||||
*/
|
||||
groupBy(iteratee?: ValueIteratee<T>): ObjectChain<Dictionary<T>>;
|
||||
groupBy(iteratee?: ValueIteratee<T>): ObjectChain<Dictionary<T[]>>;
|
||||
}
|
||||
interface ObjectChain<T> {
|
||||
/**
|
||||
|
||||
@@ -2480,23 +2480,23 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType CollectionChain<number>
|
||||
_.groupBy(dictionary, ""); // $ExpectType Dictionary<AbcObject[]>
|
||||
_.groupBy(dictionary, { a: 42 }); // $ExpectType Dictionary<AbcObject[]>
|
||||
|
||||
_("").groupBy(); // $ExpectType Object<Dictionary<string>>
|
||||
_("").groupBy(stringIterator); // $ExpectType Object<Dictionary<string>>
|
||||
_(list).groupBy(); // $ExpectType Object<Dictionary<AbcObject>>
|
||||
_(list).groupBy(valueIterator); // $ExpectType Object<Dictionary<AbcObject>>
|
||||
_(list).groupBy(""); // $ExpectType Object<Dictionary<AbcObject>>
|
||||
_(list).groupBy({ a: 42 }); // $ExpectType Object<Dictionary<AbcObject>>
|
||||
_("").groupBy(); // $ExpectType Object<Dictionary<string[]>>
|
||||
_("").groupBy(stringIterator); // $ExpectType Object<Dictionary<string[]>>
|
||||
_(list).groupBy(); // $ExpectType Object<Dictionary<AbcObject[]>>
|
||||
_(list).groupBy(valueIterator); // $ExpectType Object<Dictionary<AbcObject[]>>
|
||||
_(list).groupBy(""); // $ExpectType Object<Dictionary<AbcObject[]>>
|
||||
_(list).groupBy({ a: 42 }); // $ExpectType Object<Dictionary<AbcObject[]>>
|
||||
_(dictionary).groupBy(); // $ExpectType Object<Dictionary<AbcObject[]>>
|
||||
_(dictionary).groupBy(valueIterator); // $ExpectType Object<Dictionary<AbcObject[]>>
|
||||
_(dictionary).groupBy(""); // $ExpectType Object<Dictionary<AbcObject[]>>
|
||||
_(dictionary).groupBy({ a: 42 }); // $ExpectType Object<Dictionary<AbcObject[]>>
|
||||
|
||||
_.chain("").groupBy(); // $ExpectType ObjectChain<Dictionary<string>>
|
||||
_.chain("").groupBy(stringIterator); // $ExpectType ObjectChain<Dictionary<string>>
|
||||
_.chain(list).groupBy(); // $ExpectType ObjectChain<Dictionary<AbcObject>>
|
||||
_.chain(list).groupBy(valueIterator); // $ExpectType ObjectChain<Dictionary<AbcObject>>
|
||||
_.chain(list).groupBy(""); // $ExpectType ObjectChain<Dictionary<AbcObject>>
|
||||
_.chain(list).groupBy({ a: 42 }); // $ExpectType ObjectChain<Dictionary<AbcObject>>
|
||||
_.chain("").groupBy(); // $ExpectType ObjectChain<Dictionary<string[]>>
|
||||
_.chain("").groupBy(stringIterator); // $ExpectType ObjectChain<Dictionary<string[]>>
|
||||
_.chain(list).groupBy(); // $ExpectType ObjectChain<Dictionary<AbcObject[]>>
|
||||
_.chain(list).groupBy(valueIterator); // $ExpectType ObjectChain<Dictionary<AbcObject[]>>
|
||||
_.chain(list).groupBy(""); // $ExpectType ObjectChain<Dictionary<AbcObject[]>>
|
||||
_.chain(list).groupBy({ a: 42 }); // $ExpectType ObjectChain<Dictionary<AbcObject[]>>
|
||||
_.chain(dictionary).groupBy(); // $ExpectType ObjectChain<Dictionary<AbcObject[]>>
|
||||
_.chain(dictionary).groupBy(valueIterator); // $ExpectType ObjectChain<Dictionary<AbcObject[]>>
|
||||
_.chain(dictionary).groupBy(""); // $ExpectType ObjectChain<Dictionary<AbcObject[]>>
|
||||
|
||||
Reference in New Issue
Block a user