mirror of https://github.com/iptv-org/iptv
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
714 B
TypeScript
33 lines
714 B
TypeScript
5 months ago
|
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 {
|
||
|
const deleteSymbol = '~'
|
||
|
|
||
|
return this._data.get(key) === deleteSymbol ? '' : this._data.get(key)
|
||
|
}
|
||
|
|
||
|
getArray(key: string): string[] {
|
||
|
const deleteSymbol = '~'
|
||
|
|
||
|
return this._data.get(key) === deleteSymbol ? [] : this._data.get(key).split(';')
|
||
|
}
|
||
|
}
|