Added URL util to repo.

This commit is contained in:
DebaucheryLibrarian
2024-06-04 03:34:09 +02:00
parent e16fb2e57a
commit 74fbe29db5

15
src/utils/url.js Normal file
View File

@@ -0,0 +1,15 @@
'use strict';
function stripQuery(url) {
if (!url) {
return null;
}
const { origin, pathname } = new URL(url);
return `${origin}${pathname}`;
}
module.exports = {
stripQuery,
};