From 88fd79757b4c71ac91a652190c5ea1538235c3df Mon Sep 17 00:00:00 2001 From: robinknaapen Date: Thu, 3 May 2018 14:27:55 +0200 Subject: [PATCH] Fix empty JSON bug --- serializer.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/serializer.js b/serializer.js index e939f9a..b6edb0e 100644 --- a/serializer.js +++ b/serializer.js @@ -193,7 +193,7 @@ class Serializer { } } else { let d = f.serialize(); - if (f !== null) { + if (d !== null) { if (k == "") { json = d; continue; @@ -202,8 +202,7 @@ class Serializer { } } } - return json; - } + return Object.keys(json).length > 0 ? json : null;} } class Validator {