{"size": 2431, "ext": "js", "max_stars_repo_path": "node_modules/webpack-config/dist/ConfigPathResolver.js", "max_stars_repo_name": "boy108zon/react-component-bootstrap-ajax", "max_stars_repo_stars_event_min_datetime": "2019-08-24T07:39:40.000Z", "max_stars_repo_stars_event_max_datetime": "2019-08-24T07:39:40.000Z", "max_issues_repo_path": "node_modules/webpack-config/dist/ConfigPathResolver.js", "max_issues_repo_name": "boy108zon/react-component-bootstrap-ajax", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "node_modules/webpack-config/dist/ConfigPathResolver.js", "max_forks_repo_name": "boy108zon/react-component-bootstrap-ajax", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.375, "max_line_length": 122, "alphanum_fraction": 0.6898395722}
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = require('babel-runtime/helpers/createClass');

var _createClass3 = _interopRequireDefault(_createClass2);

var _weakMap = require('babel-runtime/core-js/weak-map');

var _weakMap2 = _interopRequireDefault(_weakMap);

var _lodash = require('lodash');

var _ConfigStrategyList = require('./ConfigStrategyList');

var _ConfigStrategyList2 = _interopRequireDefault(_ConfigStrategyList);

var _ConfigPathResolvers = require('./ConfigPathResolvers');

var _ConfigPathResolvers2 = _interopRequireDefault(_ConfigPathResolvers);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * @private
 * @type {WeakMap}
 */
var PATH_RESOLVERS = new _weakMap2.default();

/**
 * @private
 * @type {WeakMap}
 */
var STRING_RESOLVER = new _weakMap2.default();

/**
 * @class
 */

var ConfigPathResolver = function () {
  /**
   * @constructor
   * @param {ConfigStringResolver} stringResolver
   * @param {Function[]} [pathResolvers]
   */
  function ConfigPathResolver(stringResolver) {
    var pathResolvers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _ConfigPathResolvers2.default;
    (0, _classCallCheck3.default)(this, ConfigPathResolver);

    STRING_RESOLVER.set(this, stringResolver);
    PATH_RESOLVERS.set(this, _ConfigStrategyList2.default.from(pathResolvers));
  }

  /**
   * @readonly
   * @type {ConfigStringResolver}
   */


  (0, _createClass3.default)(ConfigPathResolver, [{
    key: 'resolve',


    /**
     * @param {String} value
     * @returns {String}
     */
    value: function resolve(value) {
      value = this.stringResolver.resolve(value);

      return this.pathResolvers.resolve(value, function (x) {
        return (0, _lodash.isString)(x);
      });
    }
  }, {
    key: 'stringResolver',
    get: function get() {
      return STRING_RESOLVER.get(this);
    }

    /**
     * @readonly
     * @type {ConfigStrategyList}
     */

  }, {
    key: 'pathResolvers',
    get: function get() {
      return PATH_RESOLVERS.get(this);
    }
  }]);
  return ConfigPathResolver;
}();

exports.default = ConfigPathResolver;
module.exports = exports['default'];
//# sourceMappingURL=ConfigPathResolver.js.map