Tries to execute function transform. In case of an exception, it returns fallback instead.
transform
fallback
import { safeCatch } from "flurp";const tryMath = E.safeCatch((s: string) => Math[s](1), null);tryMath("log"); // 0tryMath("no-such-function") // null
Tries to execute function
transform
. In case of an exception, it returnsfallback
instead.Example