esnext.reflect.define-metadata.js 717 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 toMetadataKey = ReflectMetadataModule.toKey;
  7. var ordinaryDefineOwnMetadata = ReflectMetadataModule.set;
  8. // `Reflect.defineMetadata` method
  9. // https://github.com/rbuckton/reflect-metadata
  10. $({ target: 'Reflect', stat: true }, {
  11. defineMetadata: function defineMetadata(metadataKey, metadataValue, target /* , targetKey */) {
  12. var targetKey = arguments.length < 4 ? undefined : toMetadataKey(arguments[3]);
  13. ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), targetKey);
  14. }
  15. });