array-2-map
A tool that converts an array to a map.
Installation
npm install array-2-map
Usage
const toKeyMap = ; const map = ; const array = value: 'key1' label: 'KEY1' value: 'key2' label: 'KEY2' ; const map1 = ;// { key1: { value: 'key1', label: 'KEY1' }, key2: { value: 'key2', label: 'KEY2' } } const map2 = ;// {key1: "KEY1", key2: "KEY2"}