UNPKG

375 BJavaScriptView Raw
1// Object.fromEntries is not available in older iOS versions
2export default function fromEntries(entries) {
3 return entries.reduce((acc, _ref) => {
4 let [k, v] = _ref;
5
6 if (acc.hasOwnProperty(k)) {
7 throw new Error(`A value for key '${k}' already exists in the object.`);
8 }
9
10 acc[k] = v;
11 return acc;
12 }, {});
13}
14//# sourceMappingURL=fromEntries.js.map
\No newline at end of file