text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  const autoBind = require("auto-bind");
  const scalars_1 = require("./scalars");
  const naming_1 = require("./naming");
  class BaseVisitor {
      constructor(rawConfig, additionalConfig, defaultScalars = scalars_1.DEFAULT_SCALARS) {
          this._declarationBlockConfig = {};
          this._parsedConfig = {
              scalars: {
                  ...(defaultScalars || scalars_1.DEFAULT_SCALARS),
                  ...(rawConfig.scalars || {}),
              },
              convert: naming_1.convertFactory(rawConfig),
              typesPrefix: rawConfig.typesPrefix || '',
              namespacedImportName: rawConfig.namespacedImportName || null,
              externalFragments: rawConfig.externalFragments || [],
              addTypename: !rawConfig.skipTypename,
              nonOptionalTypename: !!rawConfig.nonOptionalTypename,
              ...(additionalConfig || {}),
          };
          autoBind(this);
      }
      get config() {
          return this._parsedConfig;
      }
      get scalars() {
          return this.config.scalars;
      }
      convertName(node, options) {
          const useTypesPrefix = typeof (options && options.useTypesPrefix) === 'boolean' ? options.useTypesPrefix : true;
          return (useTypesPrefix ? this.config.typesPrefix : '') + this.config.convert(node, options);
      }
  }
  exports.BaseVisitor = BaseVisitor;
  //# sourceMappingURL=base-visitor.js.map