mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-12 10:00:05 -04:00
Update scripts
This commit is contained in:
parent
8a83f23243
commit
f1d2add19a
98 changed files with 2423 additions and 1499 deletions
20
scripts/core/url.ts
Normal file
20
scripts/core/url.ts
Normal file
|
@ -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
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue