diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index af780c051..81732126c 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -5969,15 +5969,35 @@ module TestIsNaN { } // _.isNative -result = _.isNative(Array.prototype.push); -result = _(Array.prototype.push).isNative(); -{ - let value: Function|string = "foo"; - if (_.isNative(value)) { - value(); - } else { - let result: string = value; - } +module TestIsNull { + { + let value: number|Function; + + if (_.isNative(value)) { + let result: Function = value; + } + else { + let result: number = value; + } + } + + { + let result: boolean; + + result = _.isNative(any); + + result = _(1).isNative(); + result = _([]).isNative(); + result = _({}).isNative(); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(1).chain().isNative(); + result = _([]).chain().isNative(); + result = _({}).chain().isNative(); + } } // _.isNull diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 2e7bab18c..2d22f4116 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -10018,6 +10018,7 @@ declare module _ { /** * 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): value is Function; @@ -10030,6 +10031,13 @@ declare module _ { isNative(): boolean; } + interface LoDashExplicitWrapperBase { + /** + * see _.isNative + */ + isNative(): LoDashExplicitWrapper; + } + //_.isNull interface LoDashStatic { /**