esnext.reflect.get-own-metadata-keys.js 663 B

12345678910111213141516
  1. // TODO: Remove from `core-js@4`
  2. var $ = require('../internals/export');
  3. var ReflectMetadataModule = require('../internals/reflect-metadata');
  4. var anObject = require('../internals/an-object');
  5. var ordinaryOwnMetadataKeys = ReflectMetadataModule.keys;
  6. var toMetadataKey = ReflectMetadataModule.toKey;
  7. // `Reflect.getOwnMetadataKeys` method
  8. // https://github.com/rbuckton/reflect-metadata
  9. $({ target: 'Reflect', stat: true }, {
  10. getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) {
  11. var targetKey = arguments.length < 2 ? undefined : toMetadataKey(arguments[1]);
  12. return ordinaryOwnMetadataKeys(anObject(target), targetKey);
  13. }
  14. });