wrapSafe
wrapSafe<
TArgs,TResult>(fn): (…args) =>TResult|undefined
Wraps a function so that any error it throws yields undefined instead of propagating.
Type Parameters
Section titled “Type Parameters”TArgs extends unknown[]
Parameters of the wrapped function.
TResult
Section titled “TResult”TResult
Return type of the wrapped function.
Parameters
Section titled “Parameters”(…args) => TResult
The function to wrap.
Returns
Section titled “Returns”A function with the same parameters that returns fn’s result, or undefined when fn throws.
(…args) => TResult | undefined

