source: trip-planner-front/node_modules/core-js/modules/esnext.reflect.get-metadata.js@ b738035

Last change on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.0 KB
Line 
1var $ = require('../internals/export');
2var ReflectMetadataModule = require('../internals/reflect-metadata');
3var anObject = require('../internals/an-object');
4var getPrototypeOf = require('../internals/object-get-prototype-of');
5
6var ordinaryHasOwnMetadata = ReflectMetadataModule.has;
7var ordinaryGetOwnMetadata = ReflectMetadataModule.get;
8var toMetadataKey = ReflectMetadataModule.toKey;
9
10var ordinaryGetMetadata = function (MetadataKey, O, P) {
11 var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
12 if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P);
13 var parent = getPrototypeOf(O);
14 return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined;
15};
16
17// `Reflect.getMetadata` method
18// https://github.com/rbuckton/reflect-metadata
19$({ target: 'Reflect', stat: true }, {
20 getMetadata: function getMetadata(metadataKey, target /* , targetKey */) {
21 var targetKey = arguments.length < 3 ? undefined : toMetadataKey(arguments[2]);
22 return ordinaryGetMetadata(metadataKey, anObject(target), targetKey);
23 }
24});
Note: See TracBrowser for help on using the repository browser.