json-stream-lite 1.0.18 → 1.0.19
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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/parser.js +4 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/parser.js
CHANGED
|
@@ -175,11 +175,11 @@ export class JsonEntity {
|
|
|
175
175
|
throw new Error('JSON entity has already been consumed.');
|
|
176
176
|
}
|
|
177
177
|
while (!this.buffer.atEof()) {
|
|
178
|
-
await this.buffer.readStreamAsync();
|
|
179
178
|
const res = this.tryParse(() => this.read());
|
|
180
179
|
if (res !== undefined) {
|
|
181
180
|
return res;
|
|
182
181
|
}
|
|
182
|
+
await this.buffer.readStreamAsync();
|
|
183
183
|
}
|
|
184
184
|
return this.read();
|
|
185
185
|
}
|
|
@@ -489,7 +489,6 @@ export class JsonObject extends JsonEntity {
|
|
|
489
489
|
*/
|
|
490
490
|
async *membersAsync() {
|
|
491
491
|
while (!this.buffer.atEof()) {
|
|
492
|
-
await this.buffer.readStreamAsync();
|
|
493
492
|
const memberGen = this.members();
|
|
494
493
|
let currentMember = undefined;
|
|
495
494
|
while (true) {
|
|
@@ -505,6 +504,7 @@ export class JsonObject extends JsonEntity {
|
|
|
505
504
|
await currentMember.value.key.consumeAsync();
|
|
506
505
|
await currentMember.value.value.consumeAsync();
|
|
507
506
|
}
|
|
507
|
+
await this.buffer.readStreamAsync();
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
510
|
/**
|
|
@@ -580,7 +580,6 @@ export class JsonArray extends JsonEntity {
|
|
|
580
580
|
*/
|
|
581
581
|
async *itemsAsync() {
|
|
582
582
|
while (!this.buffer.atEof()) {
|
|
583
|
-
await this.buffer.readStreamAsync();
|
|
584
583
|
const itemGen = this.items();
|
|
585
584
|
let currentItem = undefined;
|
|
586
585
|
while (true) {
|
|
@@ -594,6 +593,7 @@ export class JsonArray extends JsonEntity {
|
|
|
594
593
|
yield currentItem.value;
|
|
595
594
|
await currentItem.value.consumeAsync();
|
|
596
595
|
}
|
|
596
|
+
await this.buffer.readStreamAsync();
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
599
|
/**
|
|
@@ -697,7 +697,6 @@ export class JsonKeyValueParser extends JsonEntity {
|
|
|
697
697
|
*/
|
|
698
698
|
async *parseAsync() {
|
|
699
699
|
while (!this.buffer.atEof()) {
|
|
700
|
-
await this.buffer.readStreamAsync();
|
|
701
700
|
const parserGen = this.parse();
|
|
702
701
|
let currentPair = undefined;
|
|
703
702
|
while (true) {
|
|
@@ -710,6 +709,7 @@ export class JsonKeyValueParser extends JsonEntity {
|
|
|
710
709
|
}
|
|
711
710
|
yield currentPair.value;
|
|
712
711
|
}
|
|
712
|
+
await this.buffer.readStreamAsync();
|
|
713
713
|
}
|
|
714
714
|
}
|
|
715
715
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "json-stream-lite",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
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",
|