parent
809a7e2951
commit
0e31e31786
1 changed files with 2 additions and 4 deletions
@ -1,9 +1,7 @@ |
|||||||
const call = <T = unknown>( |
const call = <T = unknown>( |
||||||
toCall: unknown, |
toCall: unknown, |
||||||
{ parameters = [], notCallableReturn }: CallOptions = {}, |
{ parameters = [], notCallableReturn }: CallOptions = {}, |
||||||
) => |
): T => |
||||||
(typeof toCall === 'function' |
typeof toCall === 'function' ? toCall(...parameters) : notCallableReturn; |
||||||
? toCall(...parameters) |
|
||||||
: notCallableReturn) as T; |
|
||||||
|
|
||||||
export default call; |
export default call; |
||||||
|
Loading…
Reference in new issue