Merge pull request #21015 from unional/patch-8

Fix lodash.isFunction typings
This commit is contained in:
Daniel Rosenwasser
2017-11-04 01:24:07 -07:00
committed by GitHub
2 changed files with 7 additions and 3 deletions

View File

@@ -9510,12 +9510,12 @@ declare namespace _ {
//_.isFunction
interface LoDashStatic {
/**
* Checks if value is classified as a Function object.
* Checks if value is a callable function.
*
* @param value The value to check.
* @return Returns true if value is correctly classified, else false.
*/
isFunction(value?: any): value is ((...args: any[]) => any) | Function;
isFunction(value: any): value is (...args: any[]) => any;
}
interface LoDashImplicitWrapper<TValue> {

View File

@@ -8060,7 +8060,11 @@ namespace TestIsFunction {
let result: Function = value;
}
else {
let result: number = value;
let result: number|Function = value;
}
if (_.isFunction(any)) {
any();
}
}