From 93bff42997eb83793520b7cdf35eafda8c2b61bf Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Wed, 13 May 2020 11:51:26 +0200 Subject: [PATCH] don't serialize twice --- lib/Persistent.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Persistent.ts b/lib/Persistent.ts index 1afad0f..668f767 100644 --- a/lib/Persistent.ts +++ b/lib/Persistent.ts @@ -31,8 +31,8 @@ export abstract class Persistent implements Assignable, Serializable { public serialize (formatted = false): string { if (formatted) - return JSON.stringify (this.to_object ()); - return JSON.stringify (this.to_object (), null, 2); + return JSON.stringify (this._data); + return JSON.stringify (this._data, null, 2); } private check_type (value: unknown, prop: PersistentTypeString): boolean {