mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-06 16:20:26 +08:00
Merge pull request #7296 from chrootsu/lodash-isNative
lodash: signatures of _.isNative have been changed
This commit is contained in:
+29
-9
@@ -5969,15 +5969,35 @@ module TestIsNaN {
|
||||
}
|
||||
|
||||
// _.isNative
|
||||
result = <boolean>_.isNative(Array.prototype.push);
|
||||
result = <boolean>_(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 = _<any>([]).isNative();
|
||||
result = _({}).isNative();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitWrapper<boolean>;
|
||||
|
||||
result = _(1).chain().isNative();
|
||||
result = _<any>([]).chain().isNative();
|
||||
result = _({}).chain().isNative();
|
||||
}
|
||||
}
|
||||
|
||||
// _.isNull
|
||||
|
||||
Vendored
+8
@@ -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<T, TWrapper> {
|
||||
/**
|
||||
* see _.isNative
|
||||
*/
|
||||
isNative(): LoDashExplicitWrapper<boolean>;
|
||||
}
|
||||
|
||||
//_.isNull
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user