From 64fd34ff1c77a61ce493c5f6652a229abdbe0f4c Mon Sep 17 00:00:00 2001 From: James Collins Date: Mon, 13 Mar 2023 22:33:18 +1000 Subject: [PATCH] added helper --- resources/js/helpers/url.ts | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 resources/js/helpers/url.ts diff --git a/resources/js/helpers/url.ts b/resources/js/helpers/url.ts new file mode 100644 index 0000000..7ffc67a --- /dev/null +++ b/resources/js/helpers/url.ts @@ -0,0 +1,6 @@ +export const urlStripAttributes = (url: string): string => { + const urlObject = new URL(url); + urlObject.search = ""; + urlObject.hash = ""; + return urlObject.toString(); +};