refactor(json): fix typo (#6103)

This commit is contained in:
SoftwareSpot 2024-10-10 14:09:15 +03:00 committed by GitHub
parent 345e74f18a
commit a4cd8af96a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,9 +4,9 @@
import type { JsonValue } from "./types.ts";
import { parse } from "./_common.ts";
const branks = /^[ \t\r\n]*$/;
function isBrankString(str: string) {
return branks.test(str);
const blanks = /^[ \t\r\n]*$/;
function isBlankSpace(str: string) {
return blanks.test(str);
}
/**
@ -62,7 +62,7 @@ export class JsonParseStream extends TransformStream<string, JsonValue> {
super(
{
transform(chunk, controller) {
if (!isBrankString(chunk)) {
if (!isBlankSpace(chunk)) {
controller.enqueue(parse(chunk));
}
},