@nxtedition/lib 23.10.4 → 23.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/couch.js +11 -2
- package/package.json +1 -1
package/couch.js
CHANGED
|
@@ -308,12 +308,21 @@ export function makeCouch(opts) {
|
|
|
308
308
|
})
|
|
309
309
|
.on('close', maybeResume)
|
|
310
310
|
|
|
311
|
+
const decoder = new TextDecoder('utf-8')
|
|
311
312
|
let str = ''
|
|
312
313
|
while (true) {
|
|
313
314
|
const chunk = src.read()
|
|
314
315
|
|
|
315
|
-
|
|
316
|
-
|
|
316
|
+
let text = null
|
|
317
|
+
if (chunk != null) {
|
|
318
|
+
text = decoder.decode(chunk, { stream: true })
|
|
319
|
+
} else if (ended) {
|
|
320
|
+
text = decoder.decode() || null
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
if (text != null) {
|
|
324
|
+
const lines = (str + text).split(/\r?\n/)
|
|
325
|
+
|
|
317
326
|
str = lines.pop() ?? ''
|
|
318
327
|
|
|
319
328
|
for (const line of lines) {
|