MCPcopy Index your code
hub / github.com/simstudioai/sim / normalizeBaseUrl

Function normalizeBaseUrl

packages/ts-sdk/src/index.ts:128–134  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

126 * @returns URL without trailing slashes
127 */
128function normalizeBaseUrl(url: string): string {
129 let normalized = url
130 while (normalized.endsWith('/')) {
131 normalized = normalized.slice(0, -1)
132 }
133 return normalized
134}
135
136export class SimStudioClient {
137 private apiKey: string

Callers 2

constructorMethod · 0.70
setBaseUrlMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected