pragmatic-fp-ts
Version:
Opinionated functional programming library with easy use in mind
13 lines (12 loc) • 390 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromPairs = void 0;
const main_1 = require("./main");
// creates dictionaries from [key,value][] lists
function fromPairs(pairs) {
return (0, main_1.getValueOr)([], pairs).reduce((accum, [key, value]) => {
accum[key] = value;
return accum;
}, {});
}
exports.fromPairs = fromPairs;