UNPKG
@prelude/function
Version:
latest (0.4.1)
0.4.1
0.4.0
0.3.0
0.2.0
0.1.0
0.0.3
Function module.
@prelude/function
/
cjs
/
mute.d.ts
8 lines
(7 loc)
•
229 B
TypeScript
View Raw
1
2
3
4
5
6
7
8
/** * Mutes thunk throwing an error. * *
@returns
`defaultValue` if `thunk` throws, otherwise returns the return value of `thunk`. */
declare
const
mute
: <T, U>
(
thunk
: () => T,
defaultValue
: U
) =>
T | U;
export
default
mute;