Skip to content

Commit 08d3195

Browse files
committed
ow
1 parent e5fd906 commit 08d3195

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ class JsonParser<T> {
130130
if (skip) await this.#skipWhiteSpaces();
131131
const next = await this.#peekNonEof();
132132

133-
console.log(next);
134133
switch (next) {
135134
case '{':
136135
return this.parseObject();
@@ -157,6 +156,7 @@ class JsonParser<T> {
157156
case '9':
158157
return this.parseNumber();
159158
default:
159+
console.error(this.#text.slice(this.#index - 10));
160160
throw new Error(`Unexpected token ${next} at index ${this.#index} while parsing value in JSON`);
161161
}
162162
}

test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const testCases = [
1919
},
2020
{
2121
name: 'Object with array',
22-
input: '{title:[1,2,3],active:[{title: "test"}]}',
22+
input: '{\ntitle:[1,2,3],active:[{title: "test"}]}',
2323
expected: { title: [1, 2, 3], active: [{ title: 'test' }] }
2424
},
2525
{

0 commit comments

Comments
 (0)