(input: string)
| 361 | * Heuristic: contains path separators or ends with a known extension. |
| 362 | */ |
| 363 | const looksLikeFilePath = (input: string): boolean => { |
| 364 | const trimmed = input.trim() |
| 365 | if (trimmed.startsWith("[")) return false |
| 366 | if (trimmed.includes("/") || trimmed.includes("\\")) return true |
| 367 | if (/\.(json|yaml|yml)$/i.test(trimmed)) return true |
| 368 | return false |
| 369 | } |
| 370 | |
| 371 | /** |
| 372 | * Determine file format from extension. |