1
0
Fork 0
mirror of synced 2024-09-08 13:41:09 +12:00
budibase/packages/backend-core/src/helpers.ts

9 lines
319 B
TypeScript

/**
* Makes sure that a URL has the correct number of slashes, while maintaining the
* http(s):// double slashes.
* @param url The URL to test and remove any extra double slashes.
* @return The updated url.
*/
export function checkSlashesInUrl(url: string) {
return url.replace(/(https?:\/\/)|(\/)+/g, "$1$2")
}