mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
lodash: _.compact should remove more types (#17416)
This commit is contained in:
Vendored
+2
-2
@@ -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> {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user