* 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')
| 235 | * verbatim (trimmed) so they match exactly as a `.gitignore` line would. |
| 236 | */ |
| 237 | function extractPatternList(parsed: object, file: string, key: 'deprioritize'): string[] { |
| 238 | const raw = (parsed as ProjectConfig)[key]; |
| 239 | if (raw === undefined) return []; |
| 240 | if (!Array.isArray(raw)) { |
| 241 | logWarn(`Ignoring "${key}" in ${PROJECT_CONFIG_FILENAME}: must be an array of gitignore-style patterns`, { file }); |
| 242 | return []; |
| 243 | } |
| 244 | const out: string[] = []; |
| 245 | for (const entry of raw) { |
| 246 | if (typeof entry !== 'string' || !entry.trim()) { |
| 247 | logWarn(`Ignoring a "${key}" entry in ${PROJECT_CONFIG_FILENAME}: every pattern must be a non-empty string`, { file }); |
| 248 | continue; |
| 249 | } |
| 250 | out.push(entry.trim()); |
| 251 | } |
| 252 | return out; |
| 253 | } |
| 254 | |
| 255 | /** |
| 256 | * Validate the `exclude` patterns: an array of non-empty gitignore-style |
no test coverage detected