mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-12 10:00:05 -04:00
Create url.js
This commit is contained in:
parent
5b58d1bbde
commit
fa4b1a58f3
1 changed files with 11 additions and 0 deletions
11
scripts/core/url.js
Normal file
11
scripts/core/url.js
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue