diff options
| author | Melonai <einebeere@gmail.com> | 2021-01-20 23:18:09 +0100 |
|---|---|---|
| committer | Melonai <einebeere@gmail.com> | 2021-01-20 23:18:09 +0100 |
| commit | 826c7c47785ee01d2b9267919132ada696425344 (patch) | |
| tree | 901cc90be9a953a6c3f968b6c1abe33cc13774b4 /client/src/utils/addProtocol.ts | |
| parent | 2953dec527cedaabaa5f0eb48637c5ddd4a4103b (diff) | |
| download | shorest-826c7c47785ee01d2b9267919132ada696425344.tar.zst shorest-826c7c47785ee01d2b9267919132ada696425344.zip | |
Remade the client in SvelteKit
Diffstat (limited to 'client/src/utils/addProtocol.ts')
| -rw-r--r-- | client/src/utils/addProtocol.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/client/src/utils/addProtocol.ts b/client/src/utils/addProtocol.ts new file mode 100644 index 0000000..75c6214 --- /dev/null +++ b/client/src/utils/addProtocol.ts @@ -0,0 +1,6 @@ +export default function (url: string) { + if (!/^https?:\/\//.test(url)) { + url = "https://" + url; + } + return url; +} |
