Skip to content

Commit a37af0e

Browse files
Remove empty keys from result
1 parent 1a4dbdc commit a37af0e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tc-string-parse.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,9 @@
383383
var schema = sectionSchema.queue[index];
384384

385385
var value = getSchemaResult(schema, bits);
386-
result[schema.key] = value;
386+
if (schema.key) {
387+
result[schema.key] = value;
388+
}
387389

388390
reduceQueue(sectionSchema.queue, schema, value, result);
389391
}
@@ -398,7 +400,9 @@
398400
var schema = blockSchema.queue[index];
399401

400402
var value = getSectionResult(schema, bits);
401-
result[schema.key] = value;
403+
if (schema.key) {
404+
result[schema.key] = value;
405+
}
402406

403407
reduceQueue(blockSchema.queue, schema, value, result);
404408
}
@@ -417,7 +421,9 @@
417421
var bits = segments[index];
418422

419423
var value = getBlockResult(schema, bits);
420-
result[schema.key] = value;
424+
if (schema.key) {
425+
result[schema.key] = value;
426+
}
421427

422428
offset = 0;
423429
}

0 commit comments

Comments
 (0)