@zhsz/cool-design-dv
Version:
11 lines (10 loc) • 325 B
JavaScript
;
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
function arrayToMap(array = [], label = "label", value = "value") {
const map = /* @__PURE__ */ Object.create(null);
array.forEach((item) => {
map[item[label]] = item[value];
});
return map;
}
exports.arrayToMap = arrayToMap;