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,MAAM,SAAE,EAAQ,OAAE,EAAM,WAAE,GAAe,6BAA6B,EAAI,GAM1E,OALI,GACF,QAAQ,MACN,4CAA4C,2CAGzC,CAAE,WAAU,SAAO,IAE3B,QAAO,EAAG,WAAU,aACE,OAAO,CAAE,oBAAoB,IAC/C,IAAI,EAAO,eACX,IAAI,GACc,QAAQ,KAE9B,KAAI,EAAG,WAAU,YAAa,YAAY,EAAU,IACzD,CAEA,SAAS,OAAO,EAAK,GACnB,MAAM,EAAQ,EAAE,EAAO,SACpB,QAAQ,GAAM,EAAE,MAChB,KAAK,GAAM,EAAE,IAAI,aACjB,MAAK,CAAC,EAAG,IAAM,EAAE,MAAM,GAAK,EAAE,MAAM,KACpC,QACH,OAAO,WAAW,EAAO,EAC3B,CAEA,OAAO,QAAU,CAAE,wBAAa,wBAAa,sBAAY","file":"/npm/solhint-community@4.0.1/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/solhint-community@4.0.1/lib/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const _ = require('lodash')\nconst fs = require('fs')\nconst parser = require('@solidity-parser/parser')\nconst glob = require('glob')\nconst ignore = require('ignore')\nconst astParents = require('ast-parents')\nconst { applyExtends, loadFullConfigurationForPath } = require('./config/config-file')\nconst applyFixes = require('./apply-fixes')\nconst ruleFixer = require('./rule-fixer')\nconst Reporter = require('./reporter')\nconst TreeListener = require('./tree-listener')\nconst checkers = require('./rules/index')\n\nfunction parseInput(inputStr) {\n  try {\n    // first we try to parse the string as we normally do\n    return parser.parse(inputStr, { loc: true, range: true })\n  } catch (e) {\n    // using 'loc' may throw when inputStr is empty or only has comments\n    return parser.parse(inputStr, {})\n  }\n}\n\nfunction processStr(inputStr, config = {}, fileName = '') {\n  config = applyExtends(config)\n\n  let ast\n  try {\n    ast = parseInput(inputStr)\n  } catch (e) {\n    if (e instanceof parser.ParserError) {\n      const reporter = new Reporter([], config)\n      for (const error of e.errors) {\n        reporter.addReport(\n          error.line,\n          error.column,\n          Reporter.SEVERITY.ERROR,\n          `Parse error: ${error.message}`\n        )\n      }\n      return reporter\n    } else {\n      throw e\n    }\n  }\n\n  const tokens = parser.tokenize(inputStr, { loc: true })\n  const reporter = new Reporter(tokens, config)\n  const listener = new TreeListener(checkers(reporter, config, inputStr, tokens, fileName))\n\n  astParents(ast)\n  parser.visit(ast, listener)\n\n  return reporter\n}\n\nfunction processFile(file, config) {\n  const report = processStr(fs.readFileSync(file).toString(), config, file)\n  report.file = file\n\n  return report\n}\n\n// extraConfig is optional, an extra path to source for configs\n// rootIgnore currently is the contents of .solhintignore, but in the future\n// we'll probably have it behave the same as the configs, where an extra path\n// is passed and .solhintignore files in every subdirectory are read.\nfunction processPath(pathOrGlob, rootIgnore, extraConfigPath) {\n  return glob\n    .sync(pathOrGlob, { nodir: true })\n    .map((it) => {\n      const { filepath, config, isFallback } = loadFullConfigurationForPath(it, extraConfigPath)\n      if (isFallback) {\n        console.error(\n          `No rule configuration provided for file \"${filepath}\"! proceeding with solhint:recommended`\n        )\n      }\n      return { filepath, config }\n    })\n    .filter(({ filepath, config }) => {\n      const ignoreFilter = ignore({ allowRelativePaths: true })\n        .add(config.excludedFiles)\n        .add(rootIgnore)\n      return !ignoreFilter.ignores(filepath)\n    })\n    .map(({ filepath, config }) => processFile(filepath, config))\n}\n\nfunction fixStr(str, report) {\n  const fixes = _(report.reports)\n    .filter((x) => x.fix)\n    .map((x) => x.fix(ruleFixer))\n    .sort((a, b) => a.range[0] - b.range[0])\n    .value()\n  return applyFixes(fixes, str)\n}\n\nmodule.exports = { processPath, processFile, processStr, fixStr }\n"]}