mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
refactor(json): fix typo (#6103)
This commit is contained in:
parent
345e74f18a
commit
a4cd8af96a
@ -4,9 +4,9 @@
|
|||||||
import type { JsonValue } from "./types.ts";
|
import type { JsonValue } from "./types.ts";
|
||||||
import { parse } from "./_common.ts";
|
import { parse } from "./_common.ts";
|
||||||
|
|
||||||
const branks = /^[ \t\r\n]*$/;
|
const blanks = /^[ \t\r\n]*$/;
|
||||||
function isBrankString(str: string) {
|
function isBlankSpace(str: string) {
|
||||||
return branks.test(str);
|
return blanks.test(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -62,7 +62,7 @@ export class JsonParseStream extends TransformStream<string, JsonValue> {
|
|||||||
super(
|
super(
|
||||||
{
|
{
|
||||||
transform(chunk, controller) {
|
transform(chunk, controller) {
|
||||||
if (!isBrankString(chunk)) {
|
if (!isBlankSpace(chunk)) {
|
||||||
controller.enqueue(parse(chunk));
|
controller.enqueue(parse(chunk));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user