pragmatic-fp-ts
Version:
Opinionated functional programming library with easy use in mind
14 lines (13 loc) • 462 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.append = void 0;
const main_1 = require("./main");
function append(el, coll) {
if (arguments.length === 1) {
return (_coll) => append(el, _coll);
}
return coll instanceof Array
? [...(0, main_1.getValueOr)([], coll), (0, main_1.getValue)(el)]
: ((0, main_1.getValueOr)("", coll) + (0, main_1.getValueOr)("", el));
}
exports.append = append;