From 879e47cbe22a3df952ae802a7c5531aed546c72c Mon Sep 17 00:00:00 2001 From: Brian Zengel Date: Sat, 31 May 2014 00:27:00 -0400 Subject: [PATCH] Add lodash omit chainable defs --- lodash/lodash-tests.ts | 5 +++++ lodash/lodash.d.ts | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 953d32d37..da60a435d 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -877,6 +877,11 @@ result = _.omit({ 'name': 'moe', 'age': 40 }, ['age']); result = _.omit({ 'name': 'moe', 'age': 40 }, function (value) { return typeof value == 'number'; }); +result = _({ 'name': 'moe', 'age': 40 }).omit('age'); +result = _({ 'name': 'moe', 'age': 40 }).omit(['age']); +result = _({ 'name': 'moe', 'age': 40 }).omit(function (value) { + return typeof value == 'number'; +}); result = _.pairs({ 'moe': 30, 'larry': 40 }); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index cf227c25e..c363d6806 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -5391,6 +5391,27 @@ declare module _ { thisArg?: any): Omitted; } + interface LoDashObjectWrapper { + /** + * @see _.omit + **/ + omit( + ...keys: string[]): Omitted; + + /** + * @see _.omit + **/ + omit( + keys: string[]): Omitted; + + /** + * @see _.omit + **/ + omit( + callback: ObjectIterator, + thisArg?: any): Omitted; + } + //_.pairs interface LoDashStatic { /**