* Remove trailing slashes from a URL * Uses string operations instead of regex to prevent ReDoS attacks * @param url - The URL to normalize * @returns URL without trailing slashes
(url: string)
| 126 | * @returns URL without trailing slashes |
| 127 | */ |
| 128 | function normalizeBaseUrl(url: string): string { |
| 129 | let normalized = url |
| 130 | while (normalized.endsWith('/')) { |
| 131 | normalized = normalized.slice(0, -1) |
| 132 | } |
| 133 | return normalized |
| 134 | } |
| 135 | |
| 136 | export class SimStudioClient { |
| 137 | private apiKey: string |
no outgoing calls
no test coverage detected