esnext.reflect.get-own-metadata-keys.js 630 B

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