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