From 56065a128cc2df37643800e596666c0d11e0194b Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 22 Sep 2016 01:13:25 +0300 Subject: [PATCH] added data separation between the store and client... Signed-off-by: Alex A. Naanou --- pwiki.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pwiki.js b/pwiki.js index 826897a..db6bedc 100755 --- a/pwiki.js +++ b/pwiki.js @@ -141,11 +141,13 @@ module.pWikiData = { // XXX should from be pattern compatible??? data: function(path, value){ if(value == null){ - return this.__data ? this.__data[path] : null + return this.__data ? + JSON.parse(JSON.stringify(this.__data[path])) + : null } else { this.__data = this.__data || {} - this.__data[path] = value + this.__data[path] = JSON.parse(JSON.stringify(value)) return this } },