We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aed8257 commit c2d0a08Copy full SHA for c2d0a08
index.js
@@ -145,7 +145,6 @@ Encoder.prototype.encode = function(obj, callback){
145
146
function encodeAsString(obj) {
147
var str = '';
148
- var nsp = false;
149
150
// first is type
151
str += obj.type;
@@ -159,22 +158,17 @@ function encodeAsString(obj) {
159
158
// if we have a namespace other than `/`
160
// we append it followed by a comma `,`
161
if (obj.nsp && '/' !== obj.nsp) {
162
- nsp = true;
163
str += obj.nsp;
+ str += ',';
164
}
165
166
// immediately followed by the id
167
if (null != obj.id) {
168
- if (nsp) {
169
- str += ',';
170
- nsp = false;
171
- }
172
str += obj.id;
173
174
175
// json data
176
if (null != obj.data) {
177
- if (nsp) str += ',';
178
str += json.stringify(obj.data);
179
180
0 commit comments