UNPKG

fully-optional

Version:
23 lines (22 loc) 779 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var curryLast_1 = __importDefault(require("./curryLast")); var match_1 = __importDefault(require("./match")); var _withDefaultLazy = function (value, defaultValueFn) { return match_1.default(value, { some: function (_) { return _; }, none: defaultValueFn, }); }; function withDefaultLazy() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } return curryLast_1.default(_withDefaultLazy, args); } exports.withDefaultLazy = withDefaultLazy; exports.default = withDefaultLazy;