@rife/logger 0.0.6-beta.15 → 0.0.6-beta.17

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.
@@ -1151,19 +1151,32 @@ var __webpack_modules__ = {
1151
1151
  }
1152
1152
  module1.exports = split;
1153
1153
  },
1154
- "../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/index.js" (module1, __unused_rspack_exports, __webpack_require__) {
1154
+ "../../node_modules/.pnpm/thread-stream@4.2.0/node_modules/thread-stream/index.js" (module1, __unused_rspack_exports, __webpack_require__) {
1155
1155
  "use strict";
1156
- const { version } = __webpack_require__("../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/package.json");
1156
+ const { version } = __webpack_require__("../../node_modules/.pnpm/thread-stream@4.2.0/node_modules/thread-stream/package.json");
1157
1157
  const { EventEmitter } = __webpack_require__("events");
1158
1158
  const { Worker } = __webpack_require__("worker_threads");
1159
1159
  const { join } = __webpack_require__("path");
1160
1160
  const { pathToFileURL } = __webpack_require__("url");
1161
- const { wait } = __webpack_require__("../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/lib/wait.js");
1162
- const { WRITE_INDEX, READ_INDEX } = __webpack_require__("../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/lib/indexes.js");
1161
+ const { wait } = __webpack_require__("../../node_modules/.pnpm/thread-stream@4.2.0/node_modules/thread-stream/lib/wait.js");
1162
+ const { WRITE_INDEX, READ_INDEX, SEQ_INDEX } = __webpack_require__("../../node_modules/.pnpm/thread-stream@4.2.0/node_modules/thread-stream/lib/indexes.js");
1163
1163
  const buffer = __webpack_require__("buffer");
1164
1164
  const assert = __webpack_require__("assert");
1165
1165
  const kImpl = Symbol('kImpl');
1166
1166
  const MAX_STRING = buffer.constants.MAX_STRING_LENGTH;
1167
+ function noop() {}
1168
+ function updateState(stream, fn) {
1169
+ Atomics.add(stream[kImpl].state, SEQ_INDEX, 1);
1170
+ fn();
1171
+ Atomics.add(stream[kImpl].state, SEQ_INDEX, 1);
1172
+ Atomics.notify(stream[kImpl].state, SEQ_INDEX);
1173
+ }
1174
+ function resetIndexes(stream) {
1175
+ updateState(stream, ()=>{
1176
+ Atomics.store(stream[kImpl].state, READ_INDEX, 0);
1177
+ Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
1178
+ });
1179
+ }
1167
1180
  class FakeWeakRef {
1168
1181
  constructor(value){
1169
1182
  this._value = value;
@@ -1188,6 +1201,7 @@ var __webpack_modules__ = {
1188
1201
  const toExecute = bundlerOverrides['thread-stream-worker'] || join(__dirname, 'lib', 'worker.js');
1189
1202
  const worker = new Worker(toExecute, {
1190
1203
  ...opts.workerOpts,
1204
+ name: opts.workerOpts?.name || 'thread-stream',
1191
1205
  trackUnmanagedFds: false,
1192
1206
  workerData: {
1193
1207
  filename: 0 === filename.indexOf('file://') ? filename : pathToFileURL(filename).href,
@@ -1215,42 +1229,31 @@ var __webpack_modules__ = {
1215
1229
  }
1216
1230
  }
1217
1231
  function nextFlush(stream) {
1218
- const writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX);
1219
- let leftover = stream[kImpl].data.length - writeIndex;
1220
- if (leftover > 0) {
1221
- if (0 === stream[kImpl].buf.length) {
1222
- stream[kImpl].flushing = false;
1223
- if (stream[kImpl].ending) end(stream);
1224
- else if (stream[kImpl].needDrain) process.nextTick(drain, stream);
1232
+ while(true){
1233
+ const writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX);
1234
+ const leftover = stream[kImpl].data.length - writeIndex;
1235
+ if (leftover > 0) {
1236
+ if (0 === stream[kImpl].bufLen) {
1237
+ stream[kImpl].flushing = false;
1238
+ if (stream[kImpl].ending) end(stream);
1239
+ else if (stream[kImpl].needDrain) process.nextTick(drain, stream);
1240
+ return;
1241
+ }
1242
+ write(stream, leftover, noop);
1243
+ continue;
1244
+ }
1245
+ if (0 === leftover) {
1246
+ if (0 === writeIndex && 0 === stream[kImpl].bufLen) return;
1247
+ waitForRead(stream, ()=>{
1248
+ if (stream.destroyed) return;
1249
+ resetIndexes(stream);
1250
+ nextFlush(stream);
1251
+ });
1225
1252
  return;
1226
1253
  }
1227
- let toWrite = stream[kImpl].buf.slice(0, leftover);
1228
- let toWriteBytes = Buffer.byteLength(toWrite);
1229
- if (toWriteBytes <= leftover) {
1230
- stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
1231
- write(stream, toWrite, nextFlush.bind(null, stream));
1232
- } else stream.flush(()=>{
1233
- if (stream.destroyed) return;
1234
- Atomics.store(stream[kImpl].state, READ_INDEX, 0);
1235
- Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
1236
- Atomics.notify(stream[kImpl].state, READ_INDEX);
1237
- while(toWriteBytes > stream[kImpl].data.length){
1238
- leftover /= 2;
1239
- toWrite = stream[kImpl].buf.slice(0, leftover);
1240
- toWriteBytes = Buffer.byteLength(toWrite);
1241
- }
1242
- stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
1243
- write(stream, toWrite, nextFlush.bind(null, stream));
1244
- });
1245
- } else if (0 === leftover) {
1246
- if (0 === writeIndex && 0 === stream[kImpl].buf.length) return;
1247
- stream.flush(()=>{
1248
- Atomics.store(stream[kImpl].state, READ_INDEX, 0);
1249
- Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
1250
- Atomics.notify(stream[kImpl].state, READ_INDEX);
1251
- nextFlush(stream);
1252
- });
1253
- } else destroy(stream, new Error('overwritten'));
1254
+ destroy(stream, new Error('overwritten'));
1255
+ return;
1256
+ }
1254
1257
  }
1255
1258
  function onWorkerMessage(msg) {
1256
1259
  const stream = this.stream.deref();
@@ -1259,10 +1262,11 @@ var __webpack_modules__ = {
1259
1262
  this.terminate();
1260
1263
  return;
1261
1264
  }
1265
+ if (msg?.code == null) return;
1262
1266
  switch(msg.code){
1263
1267
  case 'READY':
1264
1268
  this.stream = new WeakRef1(stream);
1265
- stream.flush(()=>{
1269
+ waitForRead(stream, ()=>{
1266
1270
  stream[kImpl].ready = true;
1267
1271
  stream.emit('ready');
1268
1272
  });
@@ -1274,6 +1278,19 @@ var __webpack_modules__ = {
1274
1278
  if (Array.isArray(msg.args)) stream.emit(msg.name, ...msg.args);
1275
1279
  else stream.emit(msg.name, msg.args);
1276
1280
  break;
1281
+ case 'FLUSHED':
1282
+ {
1283
+ if ('thread-stream' !== msg.context) {
1284
+ destroy(stream, new Error('this should not happen: ' + msg.code));
1285
+ break;
1286
+ }
1287
+ const cb = stream[kImpl].flushCallbacks.get(msg.id);
1288
+ if (cb) {
1289
+ stream[kImpl].flushCallbacks.delete(msg.id);
1290
+ process.nextTick(cb);
1291
+ }
1292
+ break;
1293
+ }
1277
1294
  case 'WARNING':
1278
1295
  process.emitWarning(msg.err);
1279
1296
  break;
@@ -1308,13 +1325,18 @@ var __webpack_modules__ = {
1308
1325
  this[kImpl].finished = false;
1309
1326
  this[kImpl].errored = null;
1310
1327
  this[kImpl].closed = false;
1311
- this[kImpl].buf = '';
1328
+ this[kImpl].buf = [];
1329
+ this[kImpl].bufHead = 0;
1330
+ this[kImpl].bufLen = 0;
1331
+ this[kImpl].flushCallbacks = new Map();
1332
+ this[kImpl].nextFlushId = 0;
1312
1333
  this.worker = createWorker(this, opts);
1313
1334
  this.on('message', (message, transferList)=>{
1314
1335
  this.worker.postMessage(message, transferList);
1315
1336
  });
1316
1337
  }
1317
1338
  write(data) {
1339
+ const dataBuf = Buffer.isBuffer(data) ? data : Buffer.from(data);
1318
1340
  if (this[kImpl].destroyed) {
1319
1341
  error(this, new Error('the worker has exited'));
1320
1342
  return false;
@@ -1323,14 +1345,15 @@ var __webpack_modules__ = {
1323
1345
  error(this, new Error('the worker is ending'));
1324
1346
  return false;
1325
1347
  }
1326
- if (this[kImpl].flushing && this[kImpl].buf.length + data.length >= MAX_STRING) try {
1348
+ if (this[kImpl].flushing && this[kImpl].bufLen + dataBuf.length >= MAX_STRING) try {
1327
1349
  writeSync(this);
1328
1350
  this[kImpl].flushing = true;
1329
1351
  } catch (err) {
1330
1352
  destroy(this, err);
1331
1353
  return false;
1332
1354
  }
1333
- this[kImpl].buf += data;
1355
+ this[kImpl].buf.push(dataBuf);
1356
+ this[kImpl].bufLen += dataBuf.length;
1334
1357
  if (this[kImpl].sync) try {
1335
1358
  writeSync(this);
1336
1359
  return true;
@@ -1342,7 +1365,7 @@ var __webpack_modules__ = {
1342
1365
  this[kImpl].flushing = true;
1343
1366
  setImmediate(nextFlush, this);
1344
1367
  }
1345
- this[kImpl].needDrain = this[kImpl].data.length - this[kImpl].buf.length - Atomics.load(this[kImpl].state, WRITE_INDEX) <= 0;
1368
+ this[kImpl].needDrain = this[kImpl].data.length - this[kImpl].bufLen - Atomics.load(this[kImpl].state, WRITE_INDEX) <= 0;
1346
1369
  return !this[kImpl].needDrain;
1347
1370
  }
1348
1371
  end() {
@@ -1351,19 +1374,10 @@ var __webpack_modules__ = {
1351
1374
  end(this);
1352
1375
  }
1353
1376
  flush(cb) {
1354
- if (this[kImpl].destroyed) {
1355
- if ('function' == typeof cb) process.nextTick(cb, new Error('the worker has exited'));
1356
- return;
1357
- }
1358
- const writeIndex = Atomics.load(this[kImpl].state, WRITE_INDEX);
1359
- wait(this[kImpl].state, READ_INDEX, writeIndex, 1 / 0, (err, res)=>{
1360
- if (err) {
1361
- destroy(this, err);
1362
- process.nextTick(cb, err);
1363
- return;
1364
- }
1365
- if ('not-equal' === res) return void this.flush(cb);
1366
- process.nextTick(cb);
1377
+ cb = 'function' == typeof cb ? cb : noop;
1378
+ flushBuffer(this, (err)=>{
1379
+ if (err) return void process.nextTick(cb, err);
1380
+ requestWorkerFlush(this, cb);
1367
1381
  });
1368
1382
  }
1369
1383
  flushSync() {
@@ -1405,6 +1419,63 @@ var __webpack_modules__ = {
1405
1419
  return this[kImpl].errored;
1406
1420
  }
1407
1421
  }
1422
+ function flushBuffer(stream, cb) {
1423
+ if (stream[kImpl].destroyed) return void process.nextTick(cb, new Error('the worker has exited'));
1424
+ if (!stream[kImpl].sync && (stream[kImpl].flushing || stream[kImpl].bufLen > 0)) return void setImmediate(flushBuffer, stream, cb);
1425
+ waitForRead(stream, cb);
1426
+ }
1427
+ function waitForRead(stream, cb) {
1428
+ const writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX);
1429
+ wait(stream[kImpl].state, READ_INDEX, writeIndex, 1 / 0, (err, res)=>{
1430
+ if (err) {
1431
+ destroy(stream, err);
1432
+ cb(err);
1433
+ return;
1434
+ }
1435
+ if ('ok' !== res) return void waitForRead(stream, cb);
1436
+ cb();
1437
+ });
1438
+ }
1439
+ function requestWorkerFlush(stream, cb) {
1440
+ if (stream[kImpl].destroyed) return void process.nextTick(cb, new Error('the worker has exited'));
1441
+ if (!stream[kImpl].ready) {
1442
+ const onReady = ()=>{
1443
+ cleanup();
1444
+ requestWorkerFlush(stream, cb);
1445
+ };
1446
+ const onClose = ()=>{
1447
+ cleanup();
1448
+ process.nextTick(cb, new Error('the worker has exited'));
1449
+ };
1450
+ const cleanup = ()=>{
1451
+ stream.off('ready', onReady);
1452
+ stream.off('close', onClose);
1453
+ };
1454
+ stream.once('ready', onReady);
1455
+ stream.once('close', onClose);
1456
+ return;
1457
+ }
1458
+ const id = ++stream[kImpl].nextFlushId;
1459
+ stream[kImpl].flushCallbacks.set(id, cb);
1460
+ try {
1461
+ stream.worker.postMessage({
1462
+ code: 'FLUSH',
1463
+ context: 'thread-stream',
1464
+ id
1465
+ });
1466
+ } catch (err) {
1467
+ stream[kImpl].flushCallbacks.delete(id);
1468
+ destroy(stream, err);
1469
+ process.nextTick(cb, err);
1470
+ }
1471
+ }
1472
+ function failPendingFlushCallbacks(stream, err) {
1473
+ const callbacks = stream[kImpl].flushCallbacks;
1474
+ if (0 === callbacks.size) return;
1475
+ const flushErr = err || new Error('the worker has exited');
1476
+ for (const cb of callbacks.values())process.nextTick(cb, flushErr);
1477
+ callbacks.clear();
1478
+ }
1408
1479
  function error(stream, err) {
1409
1480
  setImmediate(()=>{
1410
1481
  stream.emit('error', err);
@@ -1413,6 +1484,7 @@ var __webpack_modules__ = {
1413
1484
  function destroy(stream, err) {
1414
1485
  if (stream[kImpl].destroyed) return;
1415
1486
  stream[kImpl].destroyed = true;
1487
+ failPendingFlushCallbacks(stream, err);
1416
1488
  if (err) {
1417
1489
  stream[kImpl].errored = err;
1418
1490
  error(stream, err);
@@ -1426,12 +1498,37 @@ var __webpack_modules__ = {
1426
1498
  stream.emit('close');
1427
1499
  });
1428
1500
  }
1429
- function write(stream, data, cb) {
1501
+ function write(stream, maxBytes, cb) {
1430
1502
  const current = Atomics.load(stream[kImpl].state, WRITE_INDEX);
1431
- const length = Buffer.byteLength(data);
1432
- stream[kImpl].data.write(data, current);
1433
- Atomics.store(stream[kImpl].state, WRITE_INDEX, current + length);
1434
- Atomics.notify(stream[kImpl].state, WRITE_INDEX);
1503
+ let offset = current;
1504
+ let remaining = maxBytes;
1505
+ while(remaining > 0 && 0 !== stream[kImpl].bufLen){
1506
+ const head = stream[kImpl].bufHead;
1507
+ const buf = stream[kImpl].buf[head];
1508
+ if (buf.length <= remaining) {
1509
+ buf.copy(stream[kImpl].data, offset);
1510
+ offset += buf.length;
1511
+ remaining -= buf.length;
1512
+ stream[kImpl].bufLen -= buf.length;
1513
+ stream[kImpl].bufHead = head + 1;
1514
+ if (stream[kImpl].bufHead === stream[kImpl].buf.length) {
1515
+ stream[kImpl].buf.length = 0;
1516
+ stream[kImpl].bufHead = 0;
1517
+ } else if (stream[kImpl].bufHead >= 1024 && 2 * stream[kImpl].bufHead >= stream[kImpl].buf.length) {
1518
+ stream[kImpl].buf.splice(0, stream[kImpl].bufHead);
1519
+ stream[kImpl].bufHead = 0;
1520
+ }
1521
+ continue;
1522
+ }
1523
+ buf.copy(stream[kImpl].data, offset, 0, remaining);
1524
+ stream[kImpl].buf[head] = buf.subarray(remaining);
1525
+ stream[kImpl].bufLen -= remaining;
1526
+ offset += remaining;
1527
+ remaining = 0;
1528
+ }
1529
+ updateState(stream, ()=>{
1530
+ Atomics.store(stream[kImpl].state, WRITE_INDEX, offset);
1531
+ });
1435
1532
  cb();
1436
1533
  return true;
1437
1534
  }
@@ -1441,8 +1538,9 @@ var __webpack_modules__ = {
1441
1538
  try {
1442
1539
  stream.flushSync();
1443
1540
  let readIndex = Atomics.load(stream[kImpl].state, READ_INDEX);
1444
- Atomics.store(stream[kImpl].state, WRITE_INDEX, -1);
1445
- Atomics.notify(stream[kImpl].state, WRITE_INDEX);
1541
+ updateState(stream, ()=>{
1542
+ Atomics.store(stream[kImpl].state, WRITE_INDEX, -1);
1543
+ });
1446
1544
  let spins = 0;
1447
1545
  while(-1 !== readIndex){
1448
1546
  Atomics.wait(stream[kImpl].state, READ_INDEX, readIndex, 1000);
@@ -1464,35 +1562,16 @@ var __webpack_modules__ = {
1464
1562
  else if (stream[kImpl].needDrain) process.nextTick(drain, stream);
1465
1563
  };
1466
1564
  stream[kImpl].flushing = false;
1467
- while(0 !== stream[kImpl].buf.length){
1565
+ while(0 !== stream[kImpl].bufLen){
1468
1566
  const writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX);
1469
- let leftover = stream[kImpl].data.length - writeIndex;
1567
+ const leftover = stream[kImpl].data.length - writeIndex;
1470
1568
  if (0 === leftover) {
1471
1569
  flushSync(stream);
1472
- Atomics.store(stream[kImpl].state, READ_INDEX, 0);
1473
- Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
1474
- Atomics.notify(stream[kImpl].state, READ_INDEX);
1570
+ resetIndexes(stream);
1475
1571
  continue;
1476
1572
  }
1477
1573
  if (leftover < 0) throw new Error('overwritten');
1478
- let toWrite = stream[kImpl].buf.slice(0, leftover);
1479
- let toWriteBytes = Buffer.byteLength(toWrite);
1480
- if (toWriteBytes <= leftover) {
1481
- stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
1482
- write(stream, toWrite, cb);
1483
- } else {
1484
- flushSync(stream);
1485
- Atomics.store(stream[kImpl].state, READ_INDEX, 0);
1486
- Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
1487
- Atomics.notify(stream[kImpl].state, READ_INDEX);
1488
- while(toWriteBytes > stream[kImpl].buf.length){
1489
- leftover /= 2;
1490
- toWrite = stream[kImpl].buf.slice(0, leftover);
1491
- toWriteBytes = Buffer.byteLength(toWrite);
1492
- }
1493
- stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
1494
- write(stream, toWrite, cb);
1495
- }
1574
+ write(stream, leftover, cb);
1496
1575
  }
1497
1576
  }
1498
1577
  function flushSync(stream) {
@@ -1509,16 +1588,18 @@ var __webpack_modules__ = {
1509
1588
  }
1510
1589
  module1.exports = ThreadStream;
1511
1590
  },
1512
- "../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/lib/indexes.js" (module1) {
1591
+ "../../node_modules/.pnpm/thread-stream@4.2.0/node_modules/thread-stream/lib/indexes.js" (module1) {
1513
1592
  "use strict";
1593
+ const SEQ_INDEX = 2;
1514
1594
  const WRITE_INDEX = 4;
1515
1595
  const READ_INDEX = 8;
1516
1596
  module1.exports = {
1517
1597
  WRITE_INDEX,
1518
- READ_INDEX
1598
+ READ_INDEX,
1599
+ SEQ_INDEX
1519
1600
  };
1520
1601
  },
1521
- "../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/lib/wait.js" (module1) {
1602
+ "../../node_modules/.pnpm/thread-stream@4.2.0/node_modules/thread-stream/lib/wait.js" (module1) {
1522
1603
  "use strict";
1523
1604
  const WAIT_MS = 10000;
1524
1605
  function wait(state, index, expected, timeout, done) {
@@ -1542,7 +1623,10 @@ var __webpack_modules__ = {
1542
1623
  if (max !== 1 / 0 && Date.now() > max) return void done(null, 'timed-out');
1543
1624
  const remaining = max === 1 / 0 ? WAIT_MS : Math.min(WAIT_MS, Math.max(1, max - Date.now()));
1544
1625
  const result = Atomics.waitAsync(state, index, expected, remaining);
1545
- if (result.async) result.value.then(check);
1626
+ if (result.async) result.value.then((res)=>{
1627
+ if ('ok' === res) return void done(null, 'ok');
1628
+ check();
1629
+ });
1546
1630
  else setImmediate(check);
1547
1631
  };
1548
1632
  check();
@@ -2594,7 +2678,7 @@ var __webpack_modules__ = {
2594
2678
  const diagChan = __webpack_require__("node:diagnostics_channel");
2595
2679
  const format = __webpack_require__("../../node_modules/.pnpm/quick-format-unescaped@4.0.4/node_modules/quick-format-unescaped/index.js");
2596
2680
  const { mapHttpRequest, mapHttpResponse } = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/index.js");
2597
- const SonicBoom = __webpack_require__("../../node_modules/.pnpm/sonic-boom@4.2.0/node_modules/sonic-boom/index.js");
2681
+ const SonicBoom = __webpack_require__("../../node_modules/.pnpm/sonic-boom@4.2.1/node_modules/sonic-boom/index.js");
2598
2682
  const onExit = __webpack_require__("../../node_modules/.pnpm/on-exit-leak-free@2.1.2/node_modules/on-exit-leak-free/index.js");
2599
2683
  const { lsCacheSym, chindingsSym, writeSym, serializersSym, formatOptsSym, endSym, stringifiersSym, stringifySym, stringifySafeSym, wildcardFirstSym, nestedKeySym, formattersSym, messageKeySym, errorKeySym, nestedKeyStrSym, msgPrefixSym } = __webpack_require__("../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/symbols.js");
2600
2684
  const { isMainThread } = __webpack_require__("worker_threads");
@@ -2898,7 +2982,7 @@ var __webpack_modules__ = {
2898
2982
  const { fileURLToPath } = __webpack_require__("node:url");
2899
2983
  const sleep = __webpack_require__("../../node_modules/.pnpm/atomic-sleep@1.0.0/node_modules/atomic-sleep/index.js");
2900
2984
  const onExit = __webpack_require__("../../node_modules/.pnpm/on-exit-leak-free@2.1.2/node_modules/on-exit-leak-free/index.js");
2901
- const ThreadStream = __webpack_require__("../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/index.js");
2985
+ const ThreadStream = __webpack_require__("../../node_modules/.pnpm/thread-stream@4.2.0/node_modules/thread-stream/index.js");
2902
2986
  function setupOnExit(stream) {
2903
2987
  onExit.register(stream, autoEnd);
2904
2988
  onExit.registerBeforeExit(stream, flush);
@@ -3312,7 +3396,7 @@ var __webpack_modules__ = {
3312
3396
  module1.exports["default"] = pino;
3313
3397
  module1.exports.pino = pino;
3314
3398
  },
3315
- "../../node_modules/.pnpm/sonic-boom@4.2.0/node_modules/sonic-boom/index.js" (module1, __unused_rspack_exports, __webpack_require__) {
3399
+ "../../node_modules/.pnpm/sonic-boom@4.2.1/node_modules/sonic-boom/index.js" (module1, __unused_rspack_exports, __webpack_require__) {
3316
3400
  "use strict";
3317
3401
  const fs = __webpack_require__("fs");
3318
3402
  const EventEmitter = __webpack_require__("events");
@@ -3418,8 +3502,14 @@ var __webpack_modules__ = {
3418
3502
  this.flush = flush;
3419
3503
  this.flushSync = flushSync;
3420
3504
  this._actualWrite = actualWrite;
3421
- fsWriteSync = ()=>fs.writeSync(this.fd, this._writingBuf, 'utf8');
3422
- fsWrite = ()=>fs.write(this.fd, this._writingBuf, 'utf8', this.release);
3505
+ fsWriteSync = ()=>{
3506
+ if (Buffer.isBuffer(this._writingBuf)) return fs.writeSync(this.fd, this._writingBuf);
3507
+ return fs.writeSync(this.fd, this._writingBuf, 'utf8');
3508
+ };
3509
+ fsWrite = ()=>{
3510
+ if (Buffer.isBuffer(this._writingBuf)) return fs.write(this.fd, this._writingBuf, this.release);
3511
+ return fs.write(this.fd, this._writingBuf, 'utf8', this.release);
3512
+ };
3423
3513
  } else throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
3424
3514
  if ('number' == typeof fd) {
3425
3515
  this.fd = fd;
@@ -3491,9 +3581,9 @@ var __webpack_modules__ = {
3491
3581
  }
3492
3582
  }
3493
3583
  function releaseWritingBuf(writingBuf, len, n1) {
3494
- if ('string' == typeof writingBuf && Buffer.byteLength(writingBuf) !== n1) n1 = Buffer.from(writingBuf).subarray(0, n1).toString().length;
3584
+ if ('string' == typeof writingBuf) writingBuf = Buffer.from(writingBuf);
3495
3585
  len = Math.max(len - n1, 0);
3496
- writingBuf = writingBuf.slice(n1);
3586
+ writingBuf = writingBuf.subarray(n1);
3497
3587
  return {
3498
3588
  writingBuf,
3499
3589
  len
@@ -3513,13 +3603,15 @@ var __webpack_modules__ = {
3513
3603
  }
3514
3604
  function write(data) {
3515
3605
  if (this.destroyed) throw new Error('SonicBoom destroyed');
3516
- const len = this._len + data.length;
3606
+ data = '' + data;
3607
+ const dataLen = Buffer.byteLength(data);
3608
+ const len = this._len + dataLen;
3517
3609
  const bufs = this._bufs;
3518
3610
  if (this.maxLength && len > this.maxLength) {
3519
3611
  this.emit('drop', data);
3520
3612
  return this._len < this._hwm;
3521
3613
  }
3522
- if (0 === bufs.length || bufs[bufs.length - 1].length + data.length > this.maxWrite) bufs.push('' + data);
3614
+ if (0 === bufs.length || Buffer.byteLength(bufs[bufs.length - 1]) + dataLen > this.maxWrite) bufs.push(data);
3523
3615
  else bufs[bufs.length - 1] += data;
3524
3616
  this._len = len;
3525
3617
  if (!this._writing && this._len >= this.minLength) this._actualWrite();
@@ -3637,10 +3729,10 @@ var __webpack_modules__ = {
3637
3729
  this._writingBuf = '';
3638
3730
  }
3639
3731
  let buf = '';
3640
- while(this._bufs.length || buf){
3732
+ while(this._bufs.length || buf.length){
3641
3733
  if (buf.length <= 0) buf = this._bufs[0];
3642
3734
  try {
3643
- const n1 = fs.writeSync(this.fd, buf, 'utf8');
3735
+ const n1 = Buffer.isBuffer(buf) ? fs.writeSync(this.fd, buf) : fs.writeSync(this.fd, buf, 'utf8');
3644
3736
  const releasedBufObj = releaseWritingBuf(buf, this._len, n1);
3645
3737
  buf = releasedBufObj.writingBuf;
3646
3738
  this._len = releasedBufObj.len;
@@ -3689,14 +3781,14 @@ var __webpack_modules__ = {
3689
3781
  function actualWrite() {
3690
3782
  const release = this.release;
3691
3783
  this._writing = true;
3692
- this._writingBuf = this._writingBuf || this._bufs.shift() || '';
3784
+ this._writingBuf = this._writingBuf.length ? this._writingBuf : this._bufs.shift() || '';
3693
3785
  if (this.sync) try {
3694
- const written = fs.writeSync(this.fd, this._writingBuf, 'utf8');
3786
+ const written = Buffer.isBuffer(this._writingBuf) ? fs.writeSync(this.fd, this._writingBuf) : fs.writeSync(this.fd, this._writingBuf, 'utf8');
3695
3787
  release(null, written);
3696
3788
  } catch (err) {
3697
3789
  release(err);
3698
3790
  }
3699
- else fs.write(this.fd, this._writingBuf, 'utf8', release);
3791
+ else fs.write(this.fd, this._writingBuf, release);
3700
3792
  }
3701
3793
  function actualWriteBuffer() {
3702
3794
  const release = this.release;
@@ -3737,10 +3829,10 @@ var __webpack_modules__ = {
3737
3829
  SonicBoom.default = SonicBoom;
3738
3830
  module1.exports = SonicBoom;
3739
3831
  },
3740
- "../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/package.json" (module1) {
3832
+ "../../node_modules/.pnpm/thread-stream@4.2.0/node_modules/thread-stream/package.json" (module1) {
3741
3833
  "use strict";
3742
3834
  module1.exports = {
3743
- version: "4.0.0"
3835
+ version: "4.2.0"
3744
3836
  };
3745
3837
  }
3746
3838
  };