The guard function allows you to make an async function return undefined if it rejects. This is useful when you want to handle errors in a functional way, such as returning a default value.
Guard only specific errors
The 2nd argument to guard is an error predicate. If provided, the function will only return undefined if the error matches the predicate.
Synchronous guards
The guard function also works with synchronous functions.