From c2d0a08d7f8c56567b812e1a05c62c4c593439fc Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Sat, 17 Dec 2016 03:34:00 +0100 Subject: [PATCH] =?UTF-8?q?[refactor]=C2=A0Remove=20useless=20variable=20(?= =?UTF-8?q?#55)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/index.js b/index.js index f453c0e..81273ee 100644 --- a/index.js +++ b/index.js @@ -145,7 +145,6 @@ Encoder.prototype.encode = function(obj, callback){ function encodeAsString(obj) { var str = ''; - var nsp = false; // first is type str += obj.type; @@ -159,22 +158,17 @@ function encodeAsString(obj) { // if we have a namespace other than `/` // we append it followed by a comma `,` if (obj.nsp && '/' !== obj.nsp) { - nsp = true; str += obj.nsp; + str += ','; } // immediately followed by the id if (null != obj.id) { - if (nsp) { - str += ','; - nsp = false; - } str += obj.id; } // json data if (null != obj.data) { - if (nsp) str += ','; str += json.stringify(obj.data); }