mirror of
https://github.com/iptv-org/iptv.git
synced 2026-12-01 13:07:23 +02:00
Update scripts
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import normalizeUrl from 'normalize-url'
|
||||
|
||||
export class URL {
|
||||
url: string
|
||||
|
||||
constructor(url: string) {
|
||||
this.url = url
|
||||
}
|
||||
|
||||
normalize(): URL {
|
||||
const normalized = normalizeUrl(this.url, { stripWWW: false })
|
||||
this.url = decodeURIComponent(normalized).replace(/\s/g, '+')
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
toString(): string {
|
||||
return this.url
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user