lodash: _.compact should remove more types (#17416)

This commit is contained in:
AJ Richardson
2017-06-24 10:12:46 -04:00
parent 4e5add2f77
commit e9a5643e4d
2 changed files with 6 additions and 2 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
// Type definitions for Lo-Dash 4.14
// Project: http://lodash.com/
// Definitions by: Brian Zengel <https://github.com/bczengel>, Ilya Mochalov <https://github.com/chrootsu>, Stepan Mikhaylyuk <https://github.com/stepancar>, Eric L Anderson <https://github.com/ericanderson>
// Definitions by: Brian Zengel <https://github.com/bczengel>, Ilya Mochalov <https://github.com/chrootsu>, Stepan Mikhaylyuk <https://github.com/stepancar>, Eric L Anderson <https://github.com/ericanderson>, AJ Richardson <https://github.com/aj-r>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
@@ -485,7 +485,7 @@ declare namespace _ {
* @param array The array to compact.
* @return (Array) Returns the new array of filtered values.
*/
compact<T>(array?: List<T | null | undefined> | null | undefined): T[];
compact<T>(array?: List<T | null | undefined | false | "" | 0> | null | undefined): T[];
}
interface LoDashImplicitArrayWrapperBase<T, TArray extends T[] | null | undefined, TWrapper> {
+4
View File
@@ -207,6 +207,8 @@ namespace TestChunk {
namespace TestCompact {
let array: TResult[] | null | undefined = [] as any;
let list: _.List<TResult> | null | undefined = [] as any;
let array2: Array<TResult | null | undefined | false | "" | 0> | null | undefined = any;
let list2: _.List<TResult | null | undefined | false | "" | 0> | null | undefined = any;
{
let result: TResult[];
@@ -214,6 +216,8 @@ namespace TestCompact {
result = _.compact<TResult>();
result = _.compact<TResult>(array);
result = _.compact<TResult>(list);
result = _.compact(array2);
result = _.compact(list2);
}
{