mirror of
https://github.com/better-auth/better-auth.git
synced 2026-07-27 16:53:02 -05:00
6 lines
259 B
TypeScript
6 lines
259 B
TypeScript
export const getResourceURL = (path: string, baseURL: string) => {
|
|
const normalizedBaseURL = baseURL.endsWith("/") ? baseURL : `${baseURL}/`;
|
|
const normalizedPath = path.replace(/^\/+/, "");
|
|
return new URL(normalizedPath, normalizedBaseURL).toString();
|
|
};
|