* Validate a gitignore-style pattern list under `key`. 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, key: 'deprioritize')
| 282 | * verbatim (trimmed) so they match exactly as a `.gitignore` line would. |
| 283 | */ |
| 284 | function extractPatternList(parsed: object, file: string, key: 'deprioritize'): string[] { |
| 285 | const raw = (parsed as ProjectConfig)[key]; |
| 286 | if (raw === undefined) return []; |
| 287 | if (!Array.isArray(raw)) { |
| 288 | logWarn(`Ignoring "${key}" in ${PROJECT_CONFIG_FILENAME}: must be an array of gitignore-style patterns`, { file }); |
| 289 | return []; |
| 290 | } |
| 291 | const out: string[] = []; |
| 292 | for (const entry of raw) { |
| 293 | if (typeof entry !== 'string' || !entry.trim()) { |
| 294 | logWarn(`Ignoring a "${key}" entry in ${PROJECT_CONFIG_FILENAME}: every pattern must be a non-empty string`, { file }); |
| 295 | continue; |
| 296 | } |
| 297 | out.push(entry.trim()); |
| 298 | } |
| 299 | return out; |
| 300 | } |
| 301 | |
| 302 | /** |
| 303 | * Validate the `exclude` patterns: an array of non-empty gitignore-style |
no test coverage detected