@prelude/function
Version:
Function module.
14 lines • 562 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const rescue_js_1 = __importDefault(require("./rescue.js"));
/**
* Mutes thunk throwing an error.
*
* @returns `defaultValue` if `thunk` throws, otherwise returns the return value of `thunk`.
*/
const mute = (thunk, defaultValue) => (0, rescue_js_1.default)(thunk, () => defaultValue);
exports.default = mute;
//# sourceMappingURL=mute.js.map