@cj-tech-master/excelts 3.1.0-canary.20260102065309.51d781c → 3.1.0-canary.20260102071304.d80b29d
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/dist/browser/excelts.esm.js +34 -19
- package/dist/browser/excelts.esm.js.map +1 -1
- package/dist/browser/excelts.esm.min.js +2 -2
- package/dist/browser/excelts.iife.js +34 -19
- package/dist/browser/excelts.iife.js.map +1 -1
- package/dist/browser/excelts.iife.min.js +2 -2
- package/dist/cjs/modules/stream/streams.browser.js +42 -14
- package/dist/esm/modules/stream/streams.browser.js +42 -14
- package/package.json +1 -1
|
@@ -1404,9 +1404,6 @@ class Transform extends event_emitter_1.EventEmitter {
|
|
|
1404
1404
|
this.objectMode = options?.objectMode ?? false;
|
|
1405
1405
|
const userTransform = options?.transform;
|
|
1406
1406
|
const userFlush = options?.flush;
|
|
1407
|
-
// Determine if transform function is Node.js style (has 3 params) or simple style
|
|
1408
|
-
const isNodeStyleTransform = userTransform && userTransform.length >= 3;
|
|
1409
|
-
const isNodeStyleFlush = userFlush && userFlush.length >= 1;
|
|
1410
1407
|
// Create bound references for use in TransformStream callbacks
|
|
1411
1408
|
const setController = (ctrl) => {
|
|
1412
1409
|
this._transformController = ctrl;
|
|
@@ -1454,7 +1451,7 @@ class Transform extends event_emitter_1.EventEmitter {
|
|
|
1454
1451
|
// Check for subclass _transform override first
|
|
1455
1452
|
if (hasSubclassTransform()) {
|
|
1456
1453
|
// Call subclass _transform method (Node.js style)
|
|
1457
|
-
// _transform signature is
|
|
1454
|
+
// _transform signature is (chunk, encoding, callback)
|
|
1458
1455
|
await new Promise((resolve, reject) => {
|
|
1459
1456
|
this._transform(chunk, "utf8", (err, data) => {
|
|
1460
1457
|
if (err) {
|
|
@@ -1470,9 +1467,9 @@ class Transform extends event_emitter_1.EventEmitter {
|
|
|
1470
1467
|
});
|
|
1471
1468
|
}
|
|
1472
1469
|
else if (userTransform) {
|
|
1473
|
-
|
|
1470
|
+
const transformParamCount = userTransform.length;
|
|
1471
|
+
if (transformParamCount >= 3) {
|
|
1474
1472
|
// Node.js style: transform(chunk, encoding, callback)
|
|
1475
|
-
// isNodeStyleTransform means userTransform.length >= 3
|
|
1476
1473
|
await new Promise((resolve, reject) => {
|
|
1477
1474
|
userTransform.call(getInstance(), chunk, "utf8", (err, data) => {
|
|
1478
1475
|
if (err) {
|
|
@@ -1487,11 +1484,34 @@ class Transform extends event_emitter_1.EventEmitter {
|
|
|
1487
1484
|
});
|
|
1488
1485
|
});
|
|
1489
1486
|
}
|
|
1487
|
+
else if (transformParamCount === 2) {
|
|
1488
|
+
await new Promise((resolve, reject) => {
|
|
1489
|
+
userTransform.call(getInstance(), chunk, (err, data) => {
|
|
1490
|
+
if (err) {
|
|
1491
|
+
reject(err);
|
|
1492
|
+
}
|
|
1493
|
+
else {
|
|
1494
|
+
if (data !== undefined) {
|
|
1495
|
+
controller.enqueue(data);
|
|
1496
|
+
}
|
|
1497
|
+
resolve();
|
|
1498
|
+
}
|
|
1499
|
+
});
|
|
1500
|
+
});
|
|
1501
|
+
}
|
|
1490
1502
|
else {
|
|
1491
1503
|
// Simple style: transform(chunk) => result
|
|
1492
|
-
const result =
|
|
1493
|
-
if (result
|
|
1494
|
-
|
|
1504
|
+
const result = userTransform.call(getInstance(), chunk);
|
|
1505
|
+
if (result && typeof result.then === "function") {
|
|
1506
|
+
const awaitedResult = await result;
|
|
1507
|
+
if (awaitedResult !== undefined) {
|
|
1508
|
+
controller.enqueue(awaitedResult);
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
else {
|
|
1512
|
+
if (result !== undefined) {
|
|
1513
|
+
controller.enqueue(result);
|
|
1514
|
+
}
|
|
1495
1515
|
}
|
|
1496
1516
|
}
|
|
1497
1517
|
}
|
|
@@ -1528,9 +1548,9 @@ class Transform extends event_emitter_1.EventEmitter {
|
|
|
1528
1548
|
});
|
|
1529
1549
|
}
|
|
1530
1550
|
else if (userFlush) {
|
|
1531
|
-
|
|
1551
|
+
const flushParamCount = userFlush.length;
|
|
1552
|
+
if (flushParamCount >= 1) {
|
|
1532
1553
|
// Node.js style: flush(callback)
|
|
1533
|
-
// isNodeStyleFlush means userFlush.length >= 1
|
|
1534
1554
|
await new Promise((resolve, reject) => {
|
|
1535
1555
|
userFlush.call(getInstance(), (err, data) => {
|
|
1536
1556
|
if (err) {
|
|
@@ -1547,9 +1567,17 @@ class Transform extends event_emitter_1.EventEmitter {
|
|
|
1547
1567
|
}
|
|
1548
1568
|
else {
|
|
1549
1569
|
// Simple style: flush() => result
|
|
1550
|
-
const result =
|
|
1551
|
-
if (result
|
|
1552
|
-
|
|
1570
|
+
const result = userFlush.call(getInstance());
|
|
1571
|
+
if (result && typeof result.then === "function") {
|
|
1572
|
+
const awaitedResult = await result;
|
|
1573
|
+
if (awaitedResult !== undefined && awaitedResult !== null) {
|
|
1574
|
+
controller.enqueue(awaitedResult);
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
else {
|
|
1578
|
+
if (result !== undefined && result !== null) {
|
|
1579
|
+
controller.enqueue(result);
|
|
1580
|
+
}
|
|
1553
1581
|
}
|
|
1554
1582
|
}
|
|
1555
1583
|
}
|
|
@@ -1361,9 +1361,6 @@ export class Transform extends EventEmitter {
|
|
|
1361
1361
|
this.objectMode = options?.objectMode ?? false;
|
|
1362
1362
|
const userTransform = options?.transform;
|
|
1363
1363
|
const userFlush = options?.flush;
|
|
1364
|
-
// Determine if transform function is Node.js style (has 3 params) or simple style
|
|
1365
|
-
const isNodeStyleTransform = userTransform && userTransform.length >= 3;
|
|
1366
|
-
const isNodeStyleFlush = userFlush && userFlush.length >= 1;
|
|
1367
1364
|
// Create bound references for use in TransformStream callbacks
|
|
1368
1365
|
const setController = (ctrl) => {
|
|
1369
1366
|
this._transformController = ctrl;
|
|
@@ -1411,7 +1408,7 @@ export class Transform extends EventEmitter {
|
|
|
1411
1408
|
// Check for subclass _transform override first
|
|
1412
1409
|
if (hasSubclassTransform()) {
|
|
1413
1410
|
// Call subclass _transform method (Node.js style)
|
|
1414
|
-
// _transform signature is
|
|
1411
|
+
// _transform signature is (chunk, encoding, callback)
|
|
1415
1412
|
await new Promise((resolve, reject) => {
|
|
1416
1413
|
this._transform(chunk, "utf8", (err, data) => {
|
|
1417
1414
|
if (err) {
|
|
@@ -1427,9 +1424,9 @@ export class Transform extends EventEmitter {
|
|
|
1427
1424
|
});
|
|
1428
1425
|
}
|
|
1429
1426
|
else if (userTransform) {
|
|
1430
|
-
|
|
1427
|
+
const transformParamCount = userTransform.length;
|
|
1428
|
+
if (transformParamCount >= 3) {
|
|
1431
1429
|
// Node.js style: transform(chunk, encoding, callback)
|
|
1432
|
-
// isNodeStyleTransform means userTransform.length >= 3
|
|
1433
1430
|
await new Promise((resolve, reject) => {
|
|
1434
1431
|
userTransform.call(getInstance(), chunk, "utf8", (err, data) => {
|
|
1435
1432
|
if (err) {
|
|
@@ -1444,11 +1441,34 @@ export class Transform extends EventEmitter {
|
|
|
1444
1441
|
});
|
|
1445
1442
|
});
|
|
1446
1443
|
}
|
|
1444
|
+
else if (transformParamCount === 2) {
|
|
1445
|
+
await new Promise((resolve, reject) => {
|
|
1446
|
+
userTransform.call(getInstance(), chunk, (err, data) => {
|
|
1447
|
+
if (err) {
|
|
1448
|
+
reject(err);
|
|
1449
|
+
}
|
|
1450
|
+
else {
|
|
1451
|
+
if (data !== undefined) {
|
|
1452
|
+
controller.enqueue(data);
|
|
1453
|
+
}
|
|
1454
|
+
resolve();
|
|
1455
|
+
}
|
|
1456
|
+
});
|
|
1457
|
+
});
|
|
1458
|
+
}
|
|
1447
1459
|
else {
|
|
1448
1460
|
// Simple style: transform(chunk) => result
|
|
1449
|
-
const result =
|
|
1450
|
-
if (result
|
|
1451
|
-
|
|
1461
|
+
const result = userTransform.call(getInstance(), chunk);
|
|
1462
|
+
if (result && typeof result.then === "function") {
|
|
1463
|
+
const awaitedResult = await result;
|
|
1464
|
+
if (awaitedResult !== undefined) {
|
|
1465
|
+
controller.enqueue(awaitedResult);
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
else {
|
|
1469
|
+
if (result !== undefined) {
|
|
1470
|
+
controller.enqueue(result);
|
|
1471
|
+
}
|
|
1452
1472
|
}
|
|
1453
1473
|
}
|
|
1454
1474
|
}
|
|
@@ -1485,9 +1505,9 @@ export class Transform extends EventEmitter {
|
|
|
1485
1505
|
});
|
|
1486
1506
|
}
|
|
1487
1507
|
else if (userFlush) {
|
|
1488
|
-
|
|
1508
|
+
const flushParamCount = userFlush.length;
|
|
1509
|
+
if (flushParamCount >= 1) {
|
|
1489
1510
|
// Node.js style: flush(callback)
|
|
1490
|
-
// isNodeStyleFlush means userFlush.length >= 1
|
|
1491
1511
|
await new Promise((resolve, reject) => {
|
|
1492
1512
|
userFlush.call(getInstance(), (err, data) => {
|
|
1493
1513
|
if (err) {
|
|
@@ -1504,9 +1524,17 @@ export class Transform extends EventEmitter {
|
|
|
1504
1524
|
}
|
|
1505
1525
|
else {
|
|
1506
1526
|
// Simple style: flush() => result
|
|
1507
|
-
const result =
|
|
1508
|
-
if (result
|
|
1509
|
-
|
|
1527
|
+
const result = userFlush.call(getInstance());
|
|
1528
|
+
if (result && typeof result.then === "function") {
|
|
1529
|
+
const awaitedResult = await result;
|
|
1530
|
+
if (awaitedResult !== undefined && awaitedResult !== null) {
|
|
1531
|
+
controller.enqueue(awaitedResult);
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
else {
|
|
1535
|
+
if (result !== undefined && result !== null) {
|
|
1536
|
+
controller.enqueue(result);
|
|
1537
|
+
}
|
|
1510
1538
|
}
|
|
1511
1539
|
}
|
|
1512
1540
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cj-tech-master/excelts",
|
|
3
|
-
"version": "3.1.0-canary.
|
|
3
|
+
"version": "3.1.0-canary.20260102071304.d80b29d",
|
|
4
4
|
"description": "TypeScript Excel Workbook Manager - Read and Write xlsx and csv Files.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|