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

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