source: trip-planner-front/node_modules/core-js/modules/esnext.reflect.get-metadata-keys.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.3 KB
Line 
1var $ = require('../internals/export');
2// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
3var Set = require('../modules/es.set');
4var ReflectMetadataModule = require('../internals/reflect-metadata');
5var anObject = require('../internals/an-object');
6var getPrototypeOf = require('../internals/object-get-prototype-of');
7var iterate = require('../internals/iterate');
8
9var ordinaryOwnMetadataKeys = ReflectMetadataModule.keys;
10var toMetadataKey = ReflectMetadataModule.toKey;
11
12var from = function (iter) {
13 var result = [];
14 iterate(iter, result.push, { that: result });
15 return result;
16};
17
18var ordinaryMetadataKeys = function (O, P) {
19 var oKeys = ordinaryOwnMetadataKeys(O, P);
20 var parent = getPrototypeOf(O);
21 if (parent === null) return oKeys;
22 var pKeys = ordinaryMetadataKeys(parent, P);
23 return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys;
24};
25
26// `Reflect.getMetadataKeys` method
27// https://github.com/rbuckton/reflect-metadata
28$({ target: 'Reflect', stat: true }, {
29 getMetadataKeys: function getMetadataKeys(target /* , targetKey */) {
30 var targetKey = arguments.length < 2 ? undefined : toMetadataKey(arguments[1]);
31 return ordinaryMetadataKeys(anObject(target), targetKey);
32 }
33});
Note: See TracBrowser for help on using the repository browser.