pragmatic-fp-ts
Version:
Opinionated functional programming library with easy use in mind
12 lines (11 loc) • 355 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.get = void 0;
const main_1 = require("./main");
function get(p, coll) {
if (arguments.length === 1)
return (coll_) => get(p, coll_);
const defVal = typeof p === "string" ? {} : [];
return (0, main_1.getValueOr)(defVal, coll)[p];
}
exports.get = get;