Sha256: 95c5dd26d59f3f0f2735ea2eb8c9c93e37b27b5730590d9a31ed71348350591c

Contents?: true

Size: 750 Bytes

Versions: 320

Compression:

Stored size: 750 Bytes

Contents

var metadata               = require('./_metadata')
  , anObject               = require('./_an-object')
  , toMetaKey              = metadata.key
  , getOrCreateMetadataMap = metadata.map
  , store                  = metadata.store;

metadata.exp({deleteMetadata: function deleteMetadata(metadataKey, target /*, targetKey */){
  var targetKey   = arguments.length < 3 ? undefined : toMetaKey(arguments[2])
    , metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false);
  if(metadataMap === undefined || !metadataMap['delete'](metadataKey))return false;
  if(metadataMap.size)return true;
  var targetMetadata = store.get(target);
  targetMetadata['delete'](targetKey);
  return !!targetMetadata.size || store['delete'](target);
}});

Version data entries

320 entries across 8 versions & 3 rubygems

Version Path
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-classes/node_modules/core-js/modules/es7.reflect.delete-metadata.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-classes/node_modules/core-js/library/modules/es7.reflect.delete-metadata.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-block-scoping/node_modules/core-js/modules/es7.reflect.delete-metadata.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-block-scoping/node_modules/core-js/library/modules/es7.reflect.delete-metadata.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-block-scoped-functions/node_modules/core-js/modules/es7.reflect.delete-metadata.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-block-scoped-functions/node_modules/core-js/library/modules/es7.reflect.delete-metadata.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-arrow-functions/node_modules/core-js/modules/es7.reflect.delete-metadata.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-arrow-functions/node_modules/core-js/library/modules/es7.reflect.delete-metadata.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-async-to-generator/node_modules/core-js/modules/es7.reflect.delete-metadata.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-async-to-generator/node_modules/core-js/library/modules/es7.reflect.delete-metadata.js
babel-schmooze-sprockets-0.1.0 node_modules/babel-plugin-transform-es3-property-literals/node_modules/core-js/library/modules/es7.reflect.delete-metadata.js
babel-schmooze-sprockets-0.1.0 node_modules/babel-plugin-transform-es3-member-expression-literals/node_modules/core-js/modules/es7.reflect.delete-metadata.js
babel-schmooze-sprockets-0.1.0 node_modules/babel-plugin-transform-es3-member-expression-literals/node_modules/core-js/library/modules/es7.reflect.delete-metadata.js
babel-schmooze-sprockets-0.1.0 node_modules/babel-plugin-transform-es2015-modules-amd/node_modules/core-js/modules/es7.reflect.delete-metadata.js
babel-schmooze-sprockets-0.1.0 node_modules/babel-plugin-transform-es2015-modules-amd/node_modules/core-js/library/modules/es7.reflect.delete-metadata.js
babel-schmooze-sprockets-0.1.0 node_modules/babel-plugin-transform-async-to-generator/node_modules/core-js/modules/es7.reflect.delete-metadata.js
babel-schmooze-sprockets-0.1.0 node_modules/babel-plugin-transform-async-to-generator/node_modules/core-js/library/modules/es7.reflect.delete-metadata.js
babel-schmooze-sprockets-0.1.0 node_modules/babel-plugin-syntax-function-bind/node_modules/core-js/modules/es7.reflect.delete-metadata.js
babel-schmooze-sprockets-0.1.0 node_modules/babel-plugin-syntax-function-bind/node_modules/core-js/library/modules/es7.reflect.delete-metadata.js
babel-schmooze-sprockets-0.1.0 node_modules/babel-helpers/node_modules/core-js/modules/es7.reflect.delete-metadata.js