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