Create url.js

This commit is contained in:
Aleksandr Statciuk
2023-05-01 21:33:21 +03:00
parent 687cca1b4d
commit f1d3fc49a1
+11
View File
@@ -0,0 +1,11 @@
const normalize = require('normalize-url')
const url = {}
url.normalize = function (string) {
const normalized = normalize(string, { stripWWW: false })
return decodeURIComponent(normalized).replace(/\s/g, '+')
}
module.exports = url