Skip to content

Instantly share code, notes, and snippets.

@tadeaspetak
Created November 9, 2020 16:01
Show Gist options
  • Save tadeaspetak/e4ad1841aa992ccdbe2e436999975820 to your computer and use it in GitHub Desktop.
Save tadeaspetak/e4ad1841aa992ccdbe2e436999975820 to your computer and use it in GitHub Desktop.
import path from "path";
export const joinUrl = (base: string, ...paths: string[]) => {
return path.posix
.join(base, ...paths.map((p) => p.toString()))
.replace(":/", "://");
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment