Extracts the path component from a full URL for concise log messages.
(pathOrUrl: string)
| 654 | |
| 655 | /** Extracts the path component from a full URL for concise log messages. */ |
| 656 | function shortPath(pathOrUrl: string): string { |
| 657 | try { |
| 658 | return new URL(pathOrUrl).pathname; |
| 659 | } catch { |
| 660 | return pathOrUrl; |
| 661 | } |
| 662 | } |
| 663 | |
| 664 | export function buildUrl( |
| 665 | baseUrl: string, |