(
loaded: LoadedConfigFileDetailed | null,
)
| 408 | } |
| 409 | |
| 410 | function bindSubstitutionFailures( |
| 411 | loaded: LoadedConfigFileDetailed | null, |
| 412 | ): Array<{ keyPath: string; source: "user" | "project"; message: string }> { |
| 413 | if (!loaded || loaded.warnings.length === 0 || loaded.outcome !== "substitution-failure") { |
| 414 | return []; |
| 415 | } |
| 416 | |
| 417 | const emptyPaths = collectEmptyStringPaths(loaded.config); |
| 418 | return loaded.warnings.map((message) => { |
| 419 | const matchedPath = emptyPaths.find((path) => { |
| 420 | const tail = path.split(".").at(-1) ?? path; |
| 421 | return message.includes(path) || message.toLowerCase().includes(tail.toLowerCase()); |
| 422 | }); |
| 423 | return { keyPath: matchedPath ?? "<unknown>", source: loaded.source, message }; |
| 424 | }); |
| 425 | } |
| 426 | |
| 427 | function combinedOutcome(args: { |
| 428 | sources: LoadResultDetailed["sources"]; |
no test coverage detected