| 16 | let partialsCache = null |
| 17 | |
| 18 | function loadWebApiPartials() { |
| 19 | if (partialsCache) return partialsCache |
| 20 | const map = new Map() |
| 21 | if (fs.existsSync(webapiDir)) { |
| 22 | for (const file of fs.readdirSync(webapiDir)) { |
| 23 | if (path.extname(file) !== '.mustache') continue |
| 24 | const name = path.basename(file, '.mustache') |
| 25 | map.set(name, fs.readFileSync(path.join(webapiDir, file), 'utf8')) |
| 26 | } |
| 27 | } |
| 28 | partialsCache = map |
| 29 | return map |
| 30 | } |
| 31 | |
| 32 | function resolveHelperSource(helper, helperName, config, testsPath) { |
| 33 | const builtin = path.join(helperDir, `${helper.constructor.name}.js`) |