mirror of
https://github.com/iptv-org/iptv-org.github.io.git
synced 2025-05-14 02:50:07 -04:00
Update src/
This commit is contained in:
parent
09b07e9b24
commit
86743c74f5
132 changed files with 4418 additions and 1907 deletions
31
src/models/subdivision.ts
Normal file
31
src/models/subdivision.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
import type { SubdivisionData, SubdivisionSerializedData } from '~/types/subdivision'
|
||||
|
||||
export class Subdivision {
|
||||
code: string
|
||||
name: string
|
||||
countryCode: string
|
||||
|
||||
constructor(data?: SubdivisionData) {
|
||||
if (!data) return
|
||||
|
||||
this.code = data.code
|
||||
this.name = data.name
|
||||
this.countryCode = data.country
|
||||
}
|
||||
|
||||
serialize(): SubdivisionSerializedData {
|
||||
return {
|
||||
code: this.code,
|
||||
name: this.name,
|
||||
countryCode: this.countryCode
|
||||
}
|
||||
}
|
||||
|
||||
deserialize(data: SubdivisionSerializedData): this {
|
||||
this.code = data.code
|
||||
this.name = data.name
|
||||
this.countryCode = data.countryCode
|
||||
|
||||
return this
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue