()
| 17 | .join('\n'); |
| 18 | |
| 19 | const getFiles = () => |
| 20 | glob |
| 21 | .sync(SOURCE_FILES_PATTERN) |
| 22 | .map((filePath) => { |
| 23 | const content = readFileSync(filePath, 'utf-8'); |
| 24 | const match = EXAMPLE_REGEX.exec(content); |
| 25 | // JS regexp is stateful, you need to reset lastIndex each time |
| 26 | EXAMPLE_REGEX.lastIndex = 0; |
| 27 | return match |
| 28 | ? { |
| 29 | path: filePath, |
| 30 | content: transformContent(match[2]), |
| 31 | } |
| 32 | : null; |
| 33 | }) |
| 34 | .filter(Boolean); |
| 35 | |
| 36 | const writeFiles = (files) => { |
| 37 | mkdirSync(DESTINATION_DIR); |
no test coverage detected
searching dependent graphs…