Sha256: 614cbddfccc94324e05da81a10eb06d10c235d44679a735d93c79c741859ab8d

Contents?: true

Size: 830 Bytes

Versions: 48

Compression:

Stored size: 830 Bytes

Contents

function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
  var desc = {};
  Object.keys(descriptor).forEach(function (key) {
    desc[key] = descriptor[key];
  });
  desc.enumerable = !!desc.enumerable;
  desc.configurable = !!desc.configurable;

  if ('value' in desc || desc.initializer) {
    desc.writable = true;
  }

  desc = decorators.slice().reverse().reduce(function (desc, decorator) {
    return decorator(target, property, desc) || desc;
  }, desc);

  if (context && desc.initializer !== void 0) {
    desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
    desc.initializer = undefined;
  }

  if (desc.initializer === void 0) {
    Object.defineProperty(target, property, desc);
    desc = null;
  }

  return desc;
}

module.exports = _applyDecoratedDescriptor;

Version data entries

48 entries across 48 versions & 8 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js
disco_app-0.18.0 test/dummy/node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js
disco_app-0.18.2 test/dummy/node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js
trusty-cms-5.0.7 node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js
trusty-cms-5.0.6 node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js
trusty-cms-5.0.5 node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js
trusty-cms-5.0.4 node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js
trusty-cms-5.0.3 node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js
trusty-cms-5.0.2 node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js
trusty-cms-5.0.1 node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js
trusty-cms-4.3.5 node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js
trusty-cms-5.0.0 node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js
trusty-cms-4.3.4 node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js
trusty-cms-4.3.3 node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js
trusty-cms-4.3.2 node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js
trusty-cms-4.3.1 node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js
trusty-cms-4.3 node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js
trusty-cms-4.2.3 node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js
tang-0.2.1 spec/tang_app/node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js
trusty-cms-4.2.2 node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js