Skip to content

Commit

Permalink
refactor(json): prepare for noUncheckedIndexedAccess (#4159)
Browse files Browse the repository at this point in the history
* refactor(json): prepare for `noUncheckedIndexedAccess`

* tweak

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
  • Loading branch information
syhol and iuioiua authored Jan 11, 2024
1 parent 83efac7 commit a710c21
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions json/concatenated_json_parse_stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import { toTransformStream } from "../streams/to_transform_stream.ts";
import type { JsonValue, ParseStreamOptions } from "./common.ts";
import { parse } from "./_common.ts";

const blank = new Set(" \t\r\n");
function isBlankChar(char: string) {
return blank.has(char);
function isBlankChar(char: string | undefined) {
return char !== undefined && [" ", "\t", "\r", "\n"].includes(char);
}

const primitives = new Map(
Expand Down

0 comments on commit a710c21

Please sign in to comment.