mirror of
https://github.com/iptv-org/iptv
synced 2025-12-17 02:47:33 -05:00
Update scripts
This commit is contained in:
@@ -1,34 +1,36 @@
|
||||
import { Dictionary } from '@freearhey/core'
|
||||
|
||||
export class IssueData {
|
||||
_data: Dictionary
|
||||
constructor(data: Dictionary) {
|
||||
this._data = data
|
||||
}
|
||||
|
||||
has(key: string): boolean {
|
||||
return this._data.has(key)
|
||||
}
|
||||
|
||||
missing(key: string): boolean {
|
||||
return this._data.missing(key) || this._data.get(key) === undefined
|
||||
}
|
||||
|
||||
getBoolean(key: string): boolean {
|
||||
return Boolean(this._data.get(key))
|
||||
}
|
||||
|
||||
getString(key: string): string | undefined {
|
||||
const deleteSymbol = '~'
|
||||
|
||||
return this._data.get(key) === deleteSymbol ? '' : this._data.get(key)
|
||||
}
|
||||
|
||||
getArray(key: string): string[] | undefined {
|
||||
const deleteSymbol = '~'
|
||||
|
||||
if (this._data.missing(key)) return undefined
|
||||
|
||||
return this._data.get(key) === deleteSymbol ? [] : this._data.get(key).split('\r\n')
|
||||
}
|
||||
}
|
||||
import { Dictionary } from '@freearhey/core'
|
||||
|
||||
export class IssueData {
|
||||
_data: Dictionary<string>
|
||||
constructor(data: Dictionary<string>) {
|
||||
this._data = data
|
||||
}
|
||||
|
||||
has(key: string): boolean {
|
||||
return this._data.has(key)
|
||||
}
|
||||
|
||||
missing(key: string): boolean {
|
||||
return this._data.missing(key) || this._data.get(key) === undefined
|
||||
}
|
||||
|
||||
getBoolean(key: string): boolean {
|
||||
return Boolean(this._data.get(key))
|
||||
}
|
||||
|
||||
getString(key: string): string | undefined {
|
||||
const deleteSymbol = '~'
|
||||
|
||||
return this._data.get(key) === deleteSymbol ? '' : this._data.get(key)
|
||||
}
|
||||
|
||||
getArray(key: string): string[] | undefined {
|
||||
const deleteSymbol = '~'
|
||||
|
||||
if (this._data.missing(key)) return undefined
|
||||
|
||||
const value = this._data.get(key)
|
||||
|
||||
return !value || value === deleteSymbol ? [] : value.split('\r\n')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user