added _(...).compact def

This commit is contained in:
Brian Zengel
2013-10-20 23:37:43 -04:00
parent d97f8a126c
commit 4edce674d9
2 changed files with 9 additions and 0 deletions
+2
View File
@@ -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]);
+7
View File
@@ -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. ===.