diff --git a/scripts/utils/URLs.js b/scripts/utils/URLs.js new file mode 100644 index 0000000..bd8e069 --- /dev/null +++ b/scripts/utils/URLs.js @@ -0,0 +1,16 @@ +/* +URL tools +*/ + +class URLs { + /* + Remove the protocol from the URL. + + @param {string} URL the URL to clean + */ + static clean(URL) { + return((URL.trim().replace(/(^\w+:|^)\/\//, ``).split(`?`))[0]); + } +} + +export {URLs}; \ No newline at end of file