Sha256: c3fb845a5cafba0e2bfd511573d51c6b3ba3bec0441f542d995d39fa0c6fce83

Contents?: true

Size: 1.76 KB

Versions: 64

Compression:

Stored size: 1.76 KB

Contents

var Map = require('./es6.map');
var $export = require('./_export');
var shared = require('./_shared')('metadata');
var store = shared.store || (shared.store = new (require('./es6.weak-map'))());

var getOrCreateMetadataMap = function (target, targetKey, create) {
  var targetMetadata = store.get(target);
  if (!targetMetadata) {
    if (!create) return undefined;
    store.set(target, targetMetadata = new Map());
  }
  var keyMetadata = targetMetadata.get(targetKey);
  if (!keyMetadata) {
    if (!create) return undefined;
    targetMetadata.set(targetKey, keyMetadata = new Map());
  } return keyMetadata;
};
var ordinaryHasOwnMetadata = function (MetadataKey, O, P) {
  var metadataMap = getOrCreateMetadataMap(O, P, false);
  return metadataMap === undefined ? false : metadataMap.has(MetadataKey);
};
var ordinaryGetOwnMetadata = function (MetadataKey, O, P) {
  var metadataMap = getOrCreateMetadataMap(O, P, false);
  return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey);
};
var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) {
  getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue);
};
var ordinaryOwnMetadataKeys = function (target, targetKey) {
  var metadataMap = getOrCreateMetadataMap(target, targetKey, false);
  var keys = [];
  if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); });
  return keys;
};
var toMetaKey = function (it) {
  return it === undefined || typeof it == 'symbol' ? it : String(it);
};
var exp = function (O) {
  $export($export.S, 'Reflect', O);
};

module.exports = {
  store: store,
  map: getOrCreateMetadataMap,
  has: ordinaryHasOwnMetadata,
  get: ordinaryGetOwnMetadata,
  set: ordinaryDefineOwnMetadata,
  keys: ordinaryOwnMetadataKeys,
  key: toMetaKey,
  exp: exp
};

Version data entries

64 entries across 29 versions & 8 rubygems

Version Path
immosquare-cleaner-0.1.51 node_modules/core-js/library/modules/_metadata.js
immosquare-cleaner-0.1.51 node_modules/core-js/modules/_metadata.js
immosquare-cleaner-0.1.50 node_modules/core-js/modules/_metadata.js
immosquare-cleaner-0.1.50 node_modules/core-js/library/modules/_metadata.js
immosquare-cleaner-0.1.49 node_modules/core-js/library/modules/_metadata.js
immosquare-cleaner-0.1.49 node_modules/core-js/modules/_metadata.js
immosquare-cleaner-0.1.48 node_modules/core-js/library/modules/_metadata.js
immosquare-cleaner-0.1.48 node_modules/core-js/modules/_metadata.js
immosquare-cleaner-0.1.47 node_modules/core-js/library/modules/_metadata.js
immosquare-cleaner-0.1.47 node_modules/core-js/modules/_metadata.js
immosquare-cleaner-0.1.46 node_modules/core-js/library/modules/_metadata.js
immosquare-cleaner-0.1.46 node_modules/core-js/modules/_metadata.js
immosquare-cleaner-0.1.45 node_modules/core-js/library/modules/_metadata.js
immosquare-cleaner-0.1.45 node_modules/core-js/modules/_metadata.js
immosquare-cleaner-0.1.44 node_modules/core-js/library/modules/_metadata.js
immosquare-cleaner-0.1.44 node_modules/core-js/modules/_metadata.js
immosquare-cleaner-0.1.43 node_modules/core-js/library/modules/_metadata.js
immosquare-cleaner-0.1.43 node_modules/core-js/modules/_metadata.js
immosquare-cleaner-0.1.42 node_modules/core-js/library/modules/_metadata.js
immosquare-cleaner-0.1.42 node_modules/core-js/modules/_metadata.js