From 320c169b76895a50c21191ff32af98ae22384bbc Mon Sep 17 00:00:00 2001 From: Simon Holloway Date: Wed, 10 Jan 2024 16:08:32 +0000 Subject: [PATCH] refactor(jsonc): prepare for `noUncheckedIndexedAccess` --- jsonc/parse.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jsonc/parse.ts b/jsonc/parse.ts index 8ee6872ce98a..b5001c5364f0 100644 --- a/jsonc/parse.ts +++ b/jsonc/parse.ts @@ -118,7 +118,7 @@ class JSONCParser { *#tokenize(): Generator { for (let i = 0; i < this.#length; i++) { // skip whitespace - if (this.#whitespace.has(this.#text[i])) { + if (this.#whitespace.has(this.#text[i]!)) { continue; } @@ -194,7 +194,7 @@ class JSONCParser { default: { // parse null, true, false or number token const startIndex = i; for (; i < this.#length; i++) { // read until find numberEndToken - if (this.#numberEndToken.has(this.#text[i])) { + if (this.#numberEndToken.has(this.#text[i]!)) { break; } }