2025-10-03 11:00:05 +00:00
|
|
|
const reduce = Function.bind.call(Function.call, Array.prototype.reduce);
|
|
|
|
|
const isEnumerable = Function.bind.call(Function.call, Object.prototype.propertyIsEnumerable);
|
|
|
|
|
const concat = Function.bind.call(Function.call, Array.prototype.concat);
|
|
|
|
|
const keys = Object.keys;
|
2025-09-24 06:24:52 +00:00
|
|
|
|
|
|
|
|
if (!Object.entries) {
|
2025-10-03 11:00:05 +00:00
|
|
|
Object.entries = function entries(O) {
|
|
|
|
|
return reduce(keys(O), (e, k) => concat(e, typeof k === 'string' && isEnumerable(O, k) ? [[k, O[k]]] : []), []);
|
|
|
|
|
};
|
|
|
|
|
}
|