mirror of
https://github.com/gnmyt/LicenseAPI.git
synced 2026-01-11 10:41:46 +00:00
Create javascript LicenseMeta.ts entity
This commit is contained in:
21
integrations/javascript/src/entities/LicenseMeta.ts
Normal file
21
integrations/javascript/src/entities/LicenseMeta.ts
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
export class LicenseMeta {
|
||||||
|
public readonly key: string;
|
||||||
|
public readonly value: string;
|
||||||
|
|
||||||
|
constructor(key: string, value: string) {
|
||||||
|
this.key = key;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public getAsInteger(): number {
|
||||||
|
return parseInt(this.value, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getAsDouble(): number {
|
||||||
|
return parseFloat(this.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getAsBoolean(): boolean {
|
||||||
|
return this.value.toLowerCase() === 'true';
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user