From 61f1d482f2e41eba92d8054ab2608027ae213fab Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Thu, 13 Aug 2015 02:54:18 +0500 Subject: [PATCH] lodash: added _.isNative() method --- lodash/lodash-tests.ts | 4 ++++ lodash/lodash.d.ts | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index d7d4b6f71..cfb53c128 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1069,6 +1069,10 @@ result = _({}).isMatch({}); result = _({}).isMatch({}, testIsMatchCustiomizerFn); result = _({}).isMatch({}, testIsMatchCustiomizerFn, {}); +// _.isNative +result = _.isNative(Array.prototype.push); +result = _(Array.prototype.push).isNative(); + // _.lt result = _.lt(1, 2); result = _(1).lt(2); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index acfa93dec..30f4d0e61 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -5888,6 +5888,23 @@ declare module _ { isMatch(source: Object, customizer?: isMatchCustomizer, thisArg?: any): boolean; } + //_.isNative + interface LoDashStatic { + /** + * Checks if value is a native function. + * @param value The value to check. + * @retrun Returns true if value is a native function, else false. + */ + isNative(value: any): boolean; + } + + interface LoDashWrapperBase { + /** + * see _.isNative + */ + isNative(): boolean; + } + //_.lt interface LoDashStatic { /**