json-stream-lite 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/parser.js +6 -1
- package/package.json +1 -1
package/dist/parser.js
CHANGED
|
@@ -591,7 +591,9 @@ export class JsonValue extends JsonEntity {
|
|
|
591
591
|
}
|
|
592
592
|
else {
|
|
593
593
|
super.consume();
|
|
594
|
+
this.value?.consume();
|
|
594
595
|
}
|
|
596
|
+
this.consumed = true;
|
|
595
597
|
}
|
|
596
598
|
/**
|
|
597
599
|
* Asynchronously consumes the value, ensuring it is fully read.
|
|
@@ -602,7 +604,9 @@ export class JsonValue extends JsonEntity {
|
|
|
602
604
|
}
|
|
603
605
|
else {
|
|
604
606
|
await super.consumeAsync();
|
|
607
|
+
await this.value?.consumeAsync();
|
|
605
608
|
}
|
|
609
|
+
this.consumed = true;
|
|
606
610
|
}
|
|
607
611
|
}
|
|
608
612
|
/**
|
|
@@ -696,7 +700,8 @@ export class JsonObject extends JsonEntity {
|
|
|
696
700
|
parse() {
|
|
697
701
|
const obj = {};
|
|
698
702
|
for (const { key, value } of this.members()) {
|
|
699
|
-
|
|
703
|
+
const keyString = key.read();
|
|
704
|
+
obj[keyString] = value.readValue();
|
|
700
705
|
}
|
|
701
706
|
return obj;
|
|
702
707
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "json-stream-lite",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "A lightweight, memory-efficient, zero-dependency streaming JSON parser and stringifier for JavaScript and TypeScript. It works in both Node.js and browser environments.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|