Simplify isFunctionOfType

ef85a5173d (r28310156)
This commit is contained in:
Sindre Sorhus 2018-03-29 11:56:13 +07:00
parent ef85a5173d
commit 64ced4d33c

View file

@ -133,7 +133,7 @@ namespace is { // tslint:disable-line:no-namespace
export const promise = (value: any) => nativePromise(value) || hasPromiseAPI(value);
const isFunctionOfType = (type: TypeName) => (value: any) => isObjectOfType(type)(value);
const isFunctionOfType = (type: TypeName) => isObjectOfType(type);
export const generatorFunction = isFunctionOfType(TypeName.GeneratorFunction);
export const asyncFunction = isFunctionOfType(TypeName.AsyncFunction);
export const boundFunction = (value: any) => function_(value) && !value.hasOwnProperty('prototype');