(content)
| 62 | } |
| 63 | |
| 64 | function readValidatorDescription(content) { |
| 65 | const head = 'export default '; |
| 66 | const lines = content.split('\n'); |
| 67 | |
| 68 | for (let i = 0; i < lines.length; i++) { |
| 69 | if (lines[i].startsWith(head)) { |
| 70 | const [start] = lines |
| 71 | .map((m, j) => ({ |
| 72 | index: j, |
| 73 | found: j < i && m.startsWith('/**'), |
| 74 | })) |
| 75 | .filter((m) => m.found) |
| 76 | .map((m) => m.index) |
| 77 | .reverse(); |
| 78 | const end = i - 1; |
| 79 | return lines |
| 80 | .filter((_, j) => j > start && j < end) |
| 81 | .map((m) => m.substr(2)) |
| 82 | .join('') |
| 83 | .trim(); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | return ''; |
| 88 | } |
| 89 | |
| 90 | function readValidators() { |
| 91 | const baseDir = resolve(__dirname, validationFolder); |
no test coverage detected