don't serialize twice

This commit is contained in:
Timo Hocker 2020-05-13 11:51:26 +02:00
parent 328baeb35f
commit 93bff42997

View File

@ -31,8 +31,8 @@ export abstract class Persistent implements Assignable, Serializable {
public serialize (formatted = false): string { public serialize (formatted = false): string {
if (formatted) if (formatted)
return JSON.stringify (this.to_object ()); return JSON.stringify (this._data);
return JSON.stringify (this.to_object (), null, 2); return JSON.stringify (this._data, null, 2);
} }
private check_type (value: unknown, prop: PersistentTypeString): boolean { private check_type (value: unknown, prop: PersistentTypeString): boolean {