* Check if `url` looks like an absolute local file path (not a URL scheme). * Handles Unix paths (/...), home-relative (~), and Windows drive letters (C:\...).
(url: string)
| 572 | * Handles Unix paths (/...), home-relative (~), and Windows drive letters (C:\...). |
| 573 | */ |
| 574 | function isLocalPath(url: string): boolean { |
| 575 | return ( |
| 576 | url.startsWith("/") || url.startsWith("~") || /^[A-Za-z]:[/\\]/.test(url) |
| 577 | ); |
| 578 | } |
| 579 | |
| 580 | export function validateUrl(url: string): { |
| 581 | valid: boolean; |
no outgoing calls
no test coverage detected
searching dependent graphs…