UNPKG

call-function

Version:

Invoke function if is it callable and return result otherwise undefined

5 lines (4 loc) 200 B
export declare const call: <TFunction extends (() => void) | undefined | null>( someFn: TFunction, ...args: TFunction extends () => void ? Parameters<TFunction> : never ) => ReturnType<TFunction>