437c55b286
Zotero for Windows is still built with Fx45, so we need a polyfill for Object.values().
10 lines
455 B
JavaScript
10 lines
455 B
JavaScript
if (!Object.values) {
|
|
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 = Reflect.ownKeys;
|
|
|
|
Object.values = function values(O) {
|
|
return reduce(keys(O), (v, k) => concat(v, typeof k === 'string' && isEnumerable(O, k) ? [O[k]] : []), []);
|
|
};
|
|
}
|