()
| 88 | } |
| 89 | |
| 90 | function readValidators() { |
| 91 | const baseDir = resolve(__dirname, validationFolder); |
| 92 | |
| 93 | return readdirSync(baseDir) |
| 94 | .filter( |
| 95 | (file) => |
| 96 | file.endsWith('.ts') && !file.endsWith('.test.ts') && (file.startsWith('pilet-') || file.startsWith('piral-')), |
| 97 | ) |
| 98 | .map((file) => { |
| 99 | const path = resolve(baseDir, file); |
| 100 | const content = readFileSync(path, 'utf8'); |
| 101 | return { |
| 102 | target: file.split('.')[0].split('-')[0], |
| 103 | name: file |
| 104 | .split('.')[0] |
| 105 | .split('-') |
| 106 | .filter((_, i) => i > 0) |
| 107 | .join('-'), |
| 108 | description: readValidatorDescription(content), |
| 109 | options: readValidatorOptions(content), |
| 110 | }; |
| 111 | }); |
| 112 | } |
| 113 | |
| 114 | function getCommandData(retrieve) { |
| 115 | const data = { |
no test coverage detected