From 4edce674d9b6803586823c0cf564288d1722c827 Mon Sep 17 00:00:00 2001 From: Brian Zengel Date: Sun, 20 Oct 2013 23:37:43 -0400 Subject: [PATCH] added _(...).compact def --- lodash/lodash-tests.ts | 2 ++ lodash/lodash.d.ts | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index cb4e14436..ee57f01f1 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -105,6 +105,8 @@ result = _([1, 2, 3]).valueOf(); * Arrays * *************/ result = _.compact([0, 1, false, 2, '', 3]); + result = <_.LoDashWrapper>_([0, 1, false, 2, '', 3]).compact(); + result = _.difference([1, 2, 3, 4, 5], [5, 2, 10]); result = _.rest([1, 2, 3]); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index e4a75c5c2..fb935bb6b 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -262,6 +262,13 @@ declare module _ { **/ export function compact(array: List): T[]; + interface LoDashWrapper { + /** + * @see _.compact + **/ + compact(): LoDashWrapper; + } + /** * Creates an array excluding all values of the provided arrays using strict equality for comparisons * , i.e. ===.