mirror of https://github.com/grpc/grpc-node.git
grpc-js: Add type predicate to fix errors for isFunction
This commit is contained in:
parent
7a8cd5a4bd
commit
923b44bb1c
|
@ -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]'
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue