* Validate the `includeIgnored` patterns: an array of non-empty gitignore-style * strings. A non-array value or a non-string/blank entry warns-and-skips; never * throws. Patterns are kept verbatim (trimmed) so they match exactly as a * `.gitignore` line would.
(parsed: object, file: string)
| 170 | * `.gitignore` line would. |
| 171 | */ |
| 172 | function extractIncludeIgnored(parsed: object, file: string): string[] { |
| 173 | const raw = (parsed as ProjectConfig).includeIgnored; |
| 174 | if (raw === undefined) return []; |
| 175 | if (!Array.isArray(raw)) { |
| 176 | logWarn(`Ignoring "includeIgnored" in ${PROJECT_CONFIG_FILENAME}: must be an array of gitignore-style patterns`, { file }); |
| 177 | return []; |
| 178 | } |
| 179 | |
| 180 | const out: string[] = []; |
| 181 | for (const entry of raw) { |
| 182 | if (typeof entry !== 'string' || !entry.trim()) { |
| 183 | logWarn(`Ignoring an "includeIgnored" entry in ${PROJECT_CONFIG_FILENAME}: every pattern must be a non-empty string`, { file }); |
| 184 | continue; |
| 185 | } |
| 186 | out.push(entry.trim()); |
| 187 | } |
| 188 | return out; |
| 189 | } |
| 190 | |
| 191 | /** |
| 192 | * Validate the `exclude` patterns: an array of non-empty gitignore-style |
no test coverage detected