diff --git a/json/concatenated_json_parse_stream.ts b/json/concatenated_json_parse_stream.ts index 3d41fba574f2..5437476244bb 100644 --- a/json/concatenated_json_parse_stream.ts +++ b/json/concatenated_json_parse_stream.ts @@ -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(