esnext.reflect.get-own-metadata.js 674 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 ordinaryGetOwnMetadata = ReflectMetadataModule.get;
  6. var toMetadataKey = ReflectMetadataModule.toKey;
  7. // `Reflect.getOwnMetadata` method
  8. // https://github.com/rbuckton/reflect-metadata
  9. $({ target: 'Reflect', stat: true }, {
  10. getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) {
  11. var targetKey = arguments.length < 3 ? undefined : toMetadataKey(arguments[2]);
  12. return ordinaryGetOwnMetadata(metadataKey, anObject(target), targetKey);
  13. }
  14. });