openreplay/spot/utils/smallUtils.ts

10 lines
No EOL
248 B
TypeScript

export function safeApiUrl(url: string) {
let str = url;
if (str.endsWith("/")) {
str = str.slice(0, -1);
}
if (str.includes("app.openreplay.com")) {
str = str.replace("app.openreplay.com", "api.openreplay.com");
}
return str;
}