@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.
Files changed (2) hide show
  1. package/couch.js +11 -2
  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
- if (chunk !== null) {
316
- const lines = (str + chunk).split(/\r?\n/)
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "23.10.4",
3
+ "version": "23.10.5",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",