EnumerableOwnNames.js 364 B

1234567891011121314151617
  1. 'use strict';
  2. var $TypeError = require('es-errors/type');
  3. var keys = require('object-keys');
  4. var Type = require('./Type');
  5. // https://262.ecma-international.org/6.0/#sec-enumerableownnames
  6. module.exports = function EnumerableOwnNames(O) {
  7. if (Type(O) !== 'Object') {
  8. throw new $TypeError('Assertion failed: Type(O) is not Object');
  9. }
  10. return keys(O);
  11. };