Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
"use strict";

const _require = require("./Chains"),
      ChainedMap = _require.ChainedMap,
      dopemerge = _require.dopemerge;

module.exports = class extends ChainedMap {
  constructor(parent) {
    super(parent); // @chainup

    this.use = this.parent.use;
    this.rule = this.parent.rule;
    this.extend(['loader', 'options']);
  }

  tap(f) {
    this.options(f(this.get('options')));
    return this;
  }

  merge(obj) {
    if (obj.loader) {
      this.loader(obj.loader);
    }

    if (obj.options) {
      this.options(dopemerge(this.store.get('options') || {}, obj.options));
    }

    return this;
  }

  toConfig() {
    return this.clean(this.entries() || {});
  }

};