forked from DebaucheryLibrarian/traxxx
Added URL util to repo.
This commit is contained in:
parent
e16fb2e57a
commit
74fbe29db5
|
@ -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,
|
||||||
|
};
|
Loading…
Reference in New Issue