Skip to content

Commit 6a411d0

Browse files
committed
Fix noUncheckedIndexedAccess typecheck error in jsonc test
Array indexing returns number | undefined under strict TS config; use a non-null assertion where the valid index is guaranteed by the test setup.
1 parent 7528eba commit 6a411d0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

test/jsonc.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ describe("scan", () => {
173173
const s = '{"a": 1} // tail';
174174
const { out, map } = scan(s);
175175
const closingBrace = out.indexOf("}");
176-
expect(s[map[closingBrace]]).toBe("}");
176+
const rawIdx = map[closingBrace]!;
177+
expect(s[rawIdx]).toBe("}");
177178
});
178179
});
179180

0 commit comments

Comments
 (0)