own-keys.js 720 B

1234567891011121314
  1. var getBuiltIn = require('../internals/get-built-in');
  2. var uncurryThis = require('../internals/function-uncurry-this');
  3. var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');
  4. var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');
  5. var anObject = require('../internals/an-object');
  6. var concat = uncurryThis([].concat);
  7. // all object keys, includes non-enumerable and symbols
  8. module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  9. var keys = getOwnPropertyNamesModule.f(anObject(it));
  10. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  11. return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
  12. };