Opal-Estate-Pro/node_modules/core-js/modules/_object-to-array.js

22 lines
562 B
JavaScript
Raw Normal View History

2019-09-13 06:27:52 +02:00
var DESCRIPTORS = require('./_descriptors');
var getKeys = require('./_object-keys');
var toIObject = require('./_to-iobject');
var isEnum = require('./_object-pie').f;
module.exports = function (isEntries) {
return function (it) {
var O = toIObject(it);
var keys = getKeys(O);
var length = keys.length;
var i = 0;
var result = [];
var key;
while (length > i) {
key = keys[i++];
if (!DESCRIPTORS || isEnum.call(O, key)) {
result.push(isEntries ? [key, O[key]] : O[key]);
}
}
return result;
};
};