Sha256: 4bdc400ea6a42390a6f37838ec75c1e4eb31d8e80e8d50f4c2edf20bd6c3ac9a

Contents?: true

Size: 986 Bytes

Versions: 25

Compression:

Stored size: 986 Bytes

Contents

var DESCRIPTORS = require('../internals/descriptors');
var objectKeys = require('../internals/object-keys');
var toIndexedObject = require('../internals/to-indexed-object');
var propertyIsEnumerable = require('../internals/object-property-is-enumerable').f;

// `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.call(O, key)) {
        result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
      }
    }
    return result;
  };
};

module.exports = {
  // `Object.entries` method
  // https://tc39.github.io/ecma262/#sec-object.entries
  entries: createMethod(true),
  // `Object.values` method
  // https://tc39.github.io/ecma262/#sec-object.values
  values: createMethod(false)
};

Version data entries

25 entries across 25 versions & 7 rubygems

Version Path
ezii-os-1.0.0 node_modules/core-js/internals/object-to-array.js
condenser-0.0.7 lib/condenser/processors/node_modules/core-js-pure/internals/object-to-array.js
ezii-os-0.0.0.1.0 node_modules/core-js/internals/object-to-array.js
ezii-os-0.0.0.0.1 node_modules/core-js/internals/object-to-array.js
condenser-0.0.5 lib/condenser/processors/node_modules/core-js-pure/internals/object-to-array.js