(input: string)
| 315 | * Heuristic: contains path separators or ends with a known extension. |
| 316 | */ |
| 317 | const looksLikeFilePath = (input: string): boolean => { |
| 318 | const trimmed = input.trim() |
| 319 | if (trimmed.startsWith("[")) return false |
| 320 | if (trimmed.includes("/") || trimmed.includes("\\")) return true |
| 321 | if (/\.(json|yaml|yml)$/i.test(trimmed)) return true |
| 322 | return false |
| 323 | } |
| 324 | |
| 325 | /** |
| 326 | * Determine file format from extension. |