text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.FeatureFileLoader = void 0;
  const Cache_1 = require("./Cache");
  /**
   * @private
   */
  class FeatureFileLoader {
      constructor(parser, mapper, cache = new Cache_1.Cache()) {
          this.parser = parser;
          this.mapper = mapper;
          this.cache = cache;
      }
      load(path) {
          if (this.cache.has(path)) {
              return Promise.resolve(this.cache.get(path));
          }
          return this.parser.parse(path)
              .then(document => this.mapper.map(document, path)) // eslint-disable-line unicorn/no-array-method-this-argument
              .then(map => {
              this.cache.set(path, map);
              return this.cache.get(path);
          });
      }
  }
  exports.FeatureFileLoader = FeatureFileLoader;
  //# sourceMappingURL=FeatureFileLoader.js.map