grpc-js: Add type predicate to fix errors for isFunction

This commit is contained in:
zereraz 2021-04-28 00:18:23 +05:30
parent 7a8cd5a4bd
commit 923b44bb1c
1 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,7 @@ const INTERCEPTOR_SYMBOL = Symbol();
const INTERCEPTOR_PROVIDER_SYMBOL = Symbol();
const CALL_INVOCATION_TRANSFORMER_SYMBOL = Symbol();
function isFunction<ResponseType>(arg: Metadata | CallOptions | UnaryCallback<ResponseType>): boolean {
function isFunction<ResponseType>(arg: Metadata | CallOptions | UnaryCallback<ResponseType> | undefined): arg is UnaryCallback<ResponseType>{
return Object.prototype.toString.call(arg) === '[object Function]'
}