UNPKG

@zhsz/cool-design-dv

Version:

11 lines (10 loc) 230 B
function arrayToMap(array = [], label = "label", value = "value") { const map = /* @__PURE__ */ Object.create(null); array.forEach((item) => { map[item[label]] = item[value]; }); return map; } export { arrayToMap };