init
This commit is contained in:
32
src/models/EnvParam.ts
Normal file
32
src/models/EnvParam.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { NamedId } from "./NamedId";
|
||||
|
||||
export class EnvParam implements NamedId {
|
||||
constructor(
|
||||
public id?: number,
|
||||
public name?: string,
|
||||
public value?: string,
|
||||
public isChanged: boolean = false
|
||||
) { }
|
||||
|
||||
public Changed(v: boolean = true): EnvParam {
|
||||
return new EnvParam(
|
||||
this.id,
|
||||
this.name,
|
||||
this.value,
|
||||
v);
|
||||
}
|
||||
|
||||
public sanitize(v?: string): string {
|
||||
return v?.replace(/&/g, "&")
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''')
|
||||
?? "";
|
||||
}
|
||||
|
||||
public humanize(v?: string): string {
|
||||
return v ?? "";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user