Create javascript LicenseMeta.ts entity

This commit is contained in:
Mathias Wagner
2024-07-21 17:56:56 +02:00
parent 5e710f7497
commit ee3617f053

View 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';
}
}