decord/source/1494_fromEntries.js

26 lines
629 B
JavaScript
Raw Normal View History

2026-07-20 16:05:17 +00:00
// Module ID: 1494
2026-07-24 07:16:23 +00:00
// Function ID: 17227
2026-07-20 16:05:17 +00:00
// Name: fromEntries
2026-07-23 10:11:24 +00:00
// Dependencies: [57]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 1494 (fromEntries)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray";
2026-07-20 16:05:17 +00:00
export default function fromEntries(arr) {
return arr.reduce((arg0, arg1) => {
2026-07-23 10:11:24 +00:00
const tmp = outer1_0(arg1, 2);
2026-07-20 16:05:17 +00:00
const first = tmp[0];
if (arg0.hasOwnProperty(first)) {
const _Error = Error;
const _HermesInternal = HermesInternal;
const error = new Error("A value for key '" + first + "' already exists in the object.");
throw error;
} else {
arg0[first] = tmp[1];
return arg0;
}
}, {});
};