create project
This commit is contained in:
36
kitabcitab/node_modules/core-js-pure/internals/object-to-array.js
generated
vendored
Normal file
36
kitabcitab/node_modules/core-js-pure/internals/object-to-array.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
var DESCRIPTORS = require('../internals/descriptors');
|
||||
var uncurryThis = require('../internals/function-uncurry-this');
|
||||
var objectKeys = require('../internals/object-keys');
|
||||
var toIndexedObject = require('../internals/to-indexed-object');
|
||||
var $propertyIsEnumerable = require('../internals/object-property-is-enumerable').f;
|
||||
|
||||
var propertyIsEnumerable = uncurryThis($propertyIsEnumerable);
|
||||
var push = uncurryThis([].push);
|
||||
|
||||
// `Object.{ entries, values }` methods implementation
|
||||
var createMethod = function (TO_ENTRIES) {
|
||||
return function (it) {
|
||||
var O = toIndexedObject(it);
|
||||
var keys = objectKeys(O);
|
||||
var length = keys.length;
|
||||
var i = 0;
|
||||
var result = [];
|
||||
var key;
|
||||
while (length > i) {
|
||||
key = keys[i++];
|
||||
if (!DESCRIPTORS || propertyIsEnumerable(O, key)) {
|
||||
push(result, TO_ENTRIES ? [key, O[key]] : O[key]);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
// `Object.entries` method
|
||||
// https://tc39.es/ecma262/#sec-object.entries
|
||||
entries: createMethod(true),
|
||||
// `Object.values` method
|
||||
// https://tc39.es/ecma262/#sec-object.values
|
||||
values: createMethod(false)
|
||||
};
|
||||
Reference in New Issue
Block a user