mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
added _(...).compact def
This commit is contained in:
@@ -105,6 +105,8 @@ result = <number[]>_([1, 2, 3]).valueOf();
|
||||
* Arrays *
|
||||
*************/
|
||||
result = <any[]>_.compact([0, 1, false, 2, '', 3]);
|
||||
result = <_.LoDashWrapper<any[]>>_([0, 1, false, 2, '', 3]).compact();
|
||||
|
||||
result = <number[]>_.difference([1, 2, 3, 4, 5], [5, 2, 10]);
|
||||
|
||||
result = <number[]>_.rest([1, 2, 3]);
|
||||
|
||||
Vendored
+7
@@ -262,6 +262,13 @@ declare module _ {
|
||||
**/
|
||||
export function compact<T>(array: List<T>): T[];
|
||||
|
||||
interface LoDashWrapper<T> {
|
||||
/**
|
||||
* @see _.compact
|
||||
**/
|
||||
compact<T>(): LoDashWrapper<T[]>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an array excluding all values of the provided arrays using strict equality for comparisons
|
||||
* , i.e. ===.
|
||||
|
||||
Reference in New Issue
Block a user