From a6a1e7a8a347aef7911c0a0af982bba13f75aea9 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sat, 19 Dec 2015 19:09:32 -0800 Subject: [PATCH] bugfix --- index.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/index.js b/index.js index a7b8ce5..84f18ee 100644 --- a/index.js +++ b/index.js @@ -67,16 +67,6 @@ function parsePythonConf(str, cb) { // we want to be able to rewrite the file with comments, etc obj.__keys = keys; obj.__lines = lines; - obj.toJSON = function () { - var me = this; - var copy = {}; - Object.keys(me).forEach(function (k) { - if ('__' !== k.slice(0, 2)) { - copy[k] = me[k] - } - }); - return copy; - }; cb(null, obj); } @@ -98,7 +88,11 @@ function toPyVal(val) { return val; } else if (Array.isArray(val)) { - return val.join(','); + val = val.join(','); + if (-1 === val.indexOf(',')) { + val += ','; // disambguates value from array with one element + } + return val; } return val && JSON.stringify(val);