esnext.reflect.has-own-metadata.js 688 B

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