style(daemon): satisfy the curly rule in the NDJSON differential test

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Neil
2026-07-26 22:41:54 -07:00
co-authored by Orca
parent 2fd224d396
commit f5a64ff136
+9 -3
View File
@@ -37,10 +37,14 @@ function createLegacyParser(
continue
}
buffer = next
if (!has) return
if (!has) {
return
}
const line = buffer
buffer = ''
if (line.length === 0) continue
if (line.length === 0) {
continue
}
try {
onMessage(JSON.parse(line))
} catch (e) {
@@ -93,7 +97,9 @@ describe('ndjson parser parity with the pre-slice accumulator', () => {
for (let m = 0; m < msgCount; m += 1) {
let s = ''
const len = Math.floor(rand() * 40)
for (let i = 0; i < len; i += 1) s += ALPHABET[Math.floor(rand() * ALPHABET.length)]
for (let i = 0; i < len; i += 1) {
s += ALPHABET[Math.floor(rand() * ALPHABET.length)]
}
const msg = { method: 'pty.data', params: { id: `pty-${m}`, data: s, seq: m } }
messages.push(msg)
wire += `${JSON.stringify(msg)}\n`