EnumerableOwnNames.js 412 B

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