From 42860fa15985401825d8d51e73ec497fe5876710 Mon Sep 17 00:00:00 2001 From: Melonai Date: Wed, 24 Mar 2021 09:51:36 +0100 Subject: Update SvelteKit to public beta --- client/src/utils/addProtocol.ts | 6 ------ client/src/utils/checkUrl.ts | 10 ---------- client/src/utils/debounce.ts | 12 ------------ 3 files changed, 28 deletions(-) delete mode 100644 client/src/utils/addProtocol.ts delete mode 100644 client/src/utils/checkUrl.ts delete mode 100644 client/src/utils/debounce.ts (limited to 'client/src/utils') diff --git a/client/src/utils/addProtocol.ts b/client/src/utils/addProtocol.ts deleted file mode 100644 index 75c6214..0000000 --- a/client/src/utils/addProtocol.ts +++ /dev/null @@ -1,6 +0,0 @@ -export default function (url: string) { - if (!/^https?:\/\//.test(url)) { - url = "https://" + url; - } - return url; -} diff --git a/client/src/utils/checkUrl.ts b/client/src/utils/checkUrl.ts deleted file mode 100644 index 8ed747f..0000000 --- a/client/src/utils/checkUrl.ts +++ /dev/null @@ -1,10 +0,0 @@ -import addProtocol from "./addProtocol"; - -export default function (url: string): string | null { - try { - const normalizedUrl = new URL(addProtocol(url)); - return normalizedUrl.toString(); - } catch (e) { - return null; - } -} \ No newline at end of file diff --git a/client/src/utils/debounce.ts b/client/src/utils/debounce.ts deleted file mode 100644 index 86ef3db..0000000 --- a/client/src/utils/debounce.ts +++ /dev/null @@ -1,12 +0,0 @@ -type Procedure = (...args: any[]) => any; - -export default function (f: F, duration: number) { - let timeout: ReturnType | null = null; - return function (...args: Parameters) { - if (timeout !== null) { - clearTimeout(timeout); - timeout = null; - } - timeout = setTimeout(() => f(...args), duration); - }; -} -- cgit 1.4.1