massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / internals / object-to-array.js
1 var DESCRIPTORS = require('../internals/descriptors');
2 var uncurryThis = require('../internals/function-uncurry-this');
3 var objectKeys = require('../internals/object-keys');
4 var toIndexedObject = require('../internals/to-indexed-object');
5 var $propertyIsEnumerable = require('../internals/object-property-is-enumerable').f;
6
7 var propertyIsEnumerable = uncurryThis($propertyIsEnumerable);
8 var push = uncurryThis([].push);
9
10 // `Object.{ entries, values }` methods implementation
11 var createMethod = function (TO_ENTRIES) {
12   return function (it) {
13     var O = toIndexedObject(it);
14     var keys = objectKeys(O);
15     var length = keys.length;
16     var i = 0;
17     var result = [];
18     var key;
19     while (length > i) {
20       key = keys[i++];
21       if (!DESCRIPTORS || propertyIsEnumerable(O, key)) {
22         push(result, TO_ENTRIES ? [key, O[key]] : O[key]);
23       }
24     }
25     return result;
26   };
27 };
28
29 module.exports = {
30   // `Object.entries` method
31   // https://tc39.es/ecma262/#sec-object.entries
32   entries: createMethod(true),
33   // `Object.values` method
34   // https://tc39.es/ecma262/#sec-object.values
35   values: createMethod(false)
36 };