()
| 6 | let cache; |
| 7 | module.exports = { |
| 8 | get rules() { |
| 9 | const RULES_DIR = module.exports.RULES_DIR; |
| 10 | if (!RULES_DIR) |
| 11 | return {}; |
| 12 | |
| 13 | if (!cache) { |
| 14 | cache = {}; |
| 15 | const files = fs.readdirSync(RULES_DIR) |
| 16 | .filter((filename) => filename.endsWith('.js')); |
| 17 | for (const file of files) { |
| 18 | const name = file.slice(0, -3); |
| 19 | cache[name] = require(path.resolve(RULES_DIR, file)); |
| 20 | } |
| 21 | } |
| 22 | return cache; |
| 23 | }, |
| 24 | }; |
nothing calls this directly
no test coverage detected