react-server-dom-webpack 19.0.0-rc-100dfd7dab-20240701 → 19.0.0-rc-3da26163a3-20240704

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.
@@ -1711,7 +1711,7 @@
1711
1711
  );
1712
1712
  resolveBuffer(response, id, constructor);
1713
1713
  }
1714
- function processFullRow(response, id, tag, buffer, chunk) {
1714
+ function processFullBinaryRow(response, id, tag, buffer, chunk) {
1715
1715
  switch (tag) {
1716
1716
  case 65:
1717
1717
  resolveBuffer(response, id, mergeBuffer(buffer, chunk).buffer);
@@ -1764,6 +1764,9 @@
1764
1764
  )
1765
1765
  row += stringDecoder.decode(buffer[i], decoderOptions);
1766
1766
  row += stringDecoder.decode(chunk);
1767
+ processFullStringRow(response, id, tag, row);
1768
+ }
1769
+ function processFullStringRow(response, id, tag, row) {
1767
1770
  switch (tag) {
1768
1771
  case 73:
1769
1772
  resolveModule(response, id, row);
@@ -1816,24 +1819,24 @@
1816
1819
  break;
1817
1820
  case 69:
1818
1821
  tag = JSON.parse(row);
1819
- buffer = tag.digest;
1820
- chunk = tag.env;
1822
+ var digest = tag.digest,
1823
+ env = tag.env;
1821
1824
  row = Error(
1822
1825
  tag.message ||
1823
1826
  "An error occurred in the Server Components render but no message was provided"
1824
1827
  );
1825
1828
  row.stack = tag.stack;
1826
- row.digest = buffer;
1827
- row.environmentName = chunk;
1829
+ row.digest = digest;
1830
+ row.environmentName = env;
1828
1831
  tag = response._chunks;
1829
- (buffer = tag.get(id))
1830
- ? triggerErrorOnChunk(buffer, row)
1832
+ (digest = tag.get(id))
1833
+ ? triggerErrorOnChunk(digest, row)
1831
1834
  : tag.set(id, new Chunk("rejected", null, row, response));
1832
1835
  break;
1833
1836
  case 84:
1834
1837
  tag = response._chunks;
1835
- (buffer = tag.get(id)) && "pending" !== buffer.status
1836
- ? buffer.reason.enqueueValue(row)
1838
+ (digest = tag.get(id)) && "pending" !== digest.status
1839
+ ? digest.reason.enqueueValue(row)
1837
1840
  : tag.set(id, new Chunk("fulfilled", row, null, response));
1838
1841
  break;
1839
1842
  case 68:
@@ -1902,8 +1905,8 @@
1902
1905
  break;
1903
1906
  default:
1904
1907
  (tag = response._chunks),
1905
- (buffer = tag.get(id))
1906
- ? resolveModelChunk(buffer, row)
1908
+ (digest = tag.get(id))
1909
+ ? resolveModelChunk(digest, row)
1907
1910
  : tag.set(id, new Chunk("resolved_model", row, null, response));
1908
1911
  }
1909
1912
  }
@@ -2047,84 +2050,177 @@
2047
2050
  options && options.findSourceMapURL ? options.findSourceMapURL : void 0
2048
2051
  );
2049
2052
  stream.on("data", function (chunk) {
2050
- for (
2051
- var i = 0,
2052
- rowState = response._rowState,
2053
- rowID = response._rowID,
2054
- rowTag = response._rowTag,
2055
- rowLength = response._rowLength,
2056
- buffer = response._buffer,
2057
- chunkLength = chunk.length;
2058
- i < chunkLength;
2053
+ if ("string" === typeof chunk) {
2054
+ for (
2055
+ var i = 0,
2056
+ rowState = response._rowState,
2057
+ rowID = response._rowID,
2058
+ rowTag = response._rowTag,
2059
+ rowLength = response._rowLength,
2060
+ buffer = response._buffer,
2061
+ chunkLength = chunk.length;
2062
+ i < chunkLength;
2059
2063
 
2060
- ) {
2061
- var lastIdx = -1;
2062
- switch (rowState) {
2063
- case 0:
2064
- lastIdx = chunk[i++];
2065
- 58 === lastIdx
2066
- ? (rowState = 1)
2067
- : (rowID =
2068
- (rowID << 4) |
2069
- (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
2070
- continue;
2071
- case 1:
2072
- rowState = chunk[i];
2073
- 84 === rowState ||
2074
- 65 === rowState ||
2075
- 79 === rowState ||
2076
- 111 === rowState ||
2077
- 85 === rowState ||
2078
- 83 === rowState ||
2079
- 115 === rowState ||
2080
- 76 === rowState ||
2081
- 108 === rowState ||
2082
- 71 === rowState ||
2083
- 103 === rowState ||
2084
- 77 === rowState ||
2085
- 109 === rowState ||
2086
- 86 === rowState
2087
- ? ((rowTag = rowState), (rowState = 2), i++)
2088
- : (64 < rowState && 91 > rowState) ||
2089
- 114 === rowState ||
2090
- 120 === rowState
2091
- ? ((rowTag = rowState), (rowState = 3), i++)
2092
- : ((rowTag = 0), (rowState = 3));
2093
- continue;
2094
- case 2:
2095
- lastIdx = chunk[i++];
2096
- 44 === lastIdx
2097
- ? (rowState = 4)
2098
- : (rowLength =
2099
- (rowLength << 4) |
2100
- (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
2101
- continue;
2102
- case 3:
2103
- lastIdx = chunk.indexOf(10, i);
2104
- break;
2105
- case 4:
2106
- (lastIdx = i + rowLength),
2107
- lastIdx > chunk.length && (lastIdx = -1);
2064
+ ) {
2065
+ var lastIdx = -1;
2066
+ switch (rowState) {
2067
+ case 0:
2068
+ lastIdx = chunk.charCodeAt(i++);
2069
+ 58 === lastIdx
2070
+ ? (rowState = 1)
2071
+ : (rowID =
2072
+ (rowID << 4) |
2073
+ (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
2074
+ continue;
2075
+ case 1:
2076
+ rowState = chunk.charCodeAt(i);
2077
+ 84 === rowState ||
2078
+ 65 === rowState ||
2079
+ 79 === rowState ||
2080
+ 111 === rowState ||
2081
+ 85 === rowState ||
2082
+ 83 === rowState ||
2083
+ 115 === rowState ||
2084
+ 76 === rowState ||
2085
+ 108 === rowState ||
2086
+ 71 === rowState ||
2087
+ 103 === rowState ||
2088
+ 77 === rowState ||
2089
+ 109 === rowState ||
2090
+ 86 === rowState
2091
+ ? ((rowTag = rowState), (rowState = 2), i++)
2092
+ : (64 < rowState && 91 > rowState) ||
2093
+ 114 === rowState ||
2094
+ 120 === rowState
2095
+ ? ((rowTag = rowState), (rowState = 3), i++)
2096
+ : ((rowTag = 0), (rowState = 3));
2097
+ continue;
2098
+ case 2:
2099
+ lastIdx = chunk.charCodeAt(i++);
2100
+ 44 === lastIdx
2101
+ ? (rowState = 4)
2102
+ : (rowLength =
2103
+ (rowLength << 4) |
2104
+ (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
2105
+ continue;
2106
+ case 3:
2107
+ lastIdx = chunk.indexOf("\n", i);
2108
+ break;
2109
+ case 4:
2110
+ if (84 !== rowTag)
2111
+ throw Error(
2112
+ "Binary RSC chunks cannot be encoded as strings. This is a bug in the wiring of the React streams."
2113
+ );
2114
+ if (rowLength < chunk.length || chunk.length > 3 * rowLength)
2115
+ throw Error(
2116
+ "String chunks need to be passed in their original shape. Not split into smaller string chunks. This is a bug in the wiring of the React streams."
2117
+ );
2118
+ lastIdx = chunk.length;
2119
+ }
2120
+ if (-1 < lastIdx) {
2121
+ if (0 < buffer.length)
2122
+ throw Error(
2123
+ "String chunks need to be passed in their original shape. Not split into smaller string chunks. This is a bug in the wiring of the React streams."
2124
+ );
2125
+ i = chunk.slice(i, lastIdx);
2126
+ processFullStringRow(response, rowID, rowTag, i);
2127
+ i = lastIdx;
2128
+ 3 === rowState && i++;
2129
+ rowLength = rowID = rowTag = rowState = 0;
2130
+ buffer.length = 0;
2131
+ } else if (chunk.length !== i)
2132
+ throw Error(
2133
+ "String chunks need to be passed in their original shape. Not split into smaller string chunks. This is a bug in the wiring of the React streams."
2134
+ );
2108
2135
  }
2109
- var offset = chunk.byteOffset + i;
2110
- if (-1 < lastIdx)
2111
- (rowLength = new Uint8Array(chunk.buffer, offset, lastIdx - i)),
2112
- processFullRow(response, rowID, rowTag, buffer, rowLength),
2113
- (i = lastIdx),
2114
- 3 === rowState && i++,
2115
- (rowLength = rowID = rowTag = rowState = 0),
2116
- (buffer.length = 0);
2117
- else {
2118
- chunk = new Uint8Array(chunk.buffer, offset, chunk.byteLength - i);
2119
- buffer.push(chunk);
2120
- rowLength -= chunk.byteLength;
2121
- break;
2136
+ response._rowState = rowState;
2137
+ response._rowID = rowID;
2138
+ response._rowTag = rowTag;
2139
+ response._rowLength = rowLength;
2140
+ } else {
2141
+ rowLength = 0;
2142
+ chunkLength = response._rowState;
2143
+ rowID = response._rowID;
2144
+ i = response._rowTag;
2145
+ rowState = response._rowLength;
2146
+ buffer = response._buffer;
2147
+ for (rowTag = chunk.length; rowLength < rowTag; ) {
2148
+ lastIdx = -1;
2149
+ switch (chunkLength) {
2150
+ case 0:
2151
+ lastIdx = chunk[rowLength++];
2152
+ 58 === lastIdx
2153
+ ? (chunkLength = 1)
2154
+ : (rowID =
2155
+ (rowID << 4) |
2156
+ (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
2157
+ continue;
2158
+ case 1:
2159
+ chunkLength = chunk[rowLength];
2160
+ 84 === chunkLength ||
2161
+ 65 === chunkLength ||
2162
+ 79 === chunkLength ||
2163
+ 111 === chunkLength ||
2164
+ 85 === chunkLength ||
2165
+ 83 === chunkLength ||
2166
+ 115 === chunkLength ||
2167
+ 76 === chunkLength ||
2168
+ 108 === chunkLength ||
2169
+ 71 === chunkLength ||
2170
+ 103 === chunkLength ||
2171
+ 77 === chunkLength ||
2172
+ 109 === chunkLength ||
2173
+ 86 === chunkLength
2174
+ ? ((i = chunkLength), (chunkLength = 2), rowLength++)
2175
+ : (64 < chunkLength && 91 > chunkLength) ||
2176
+ 114 === chunkLength ||
2177
+ 120 === chunkLength
2178
+ ? ((i = chunkLength), (chunkLength = 3), rowLength++)
2179
+ : ((i = 0), (chunkLength = 3));
2180
+ continue;
2181
+ case 2:
2182
+ lastIdx = chunk[rowLength++];
2183
+ 44 === lastIdx
2184
+ ? (chunkLength = 4)
2185
+ : (rowState =
2186
+ (rowState << 4) |
2187
+ (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
2188
+ continue;
2189
+ case 3:
2190
+ lastIdx = chunk.indexOf(10, rowLength);
2191
+ break;
2192
+ case 4:
2193
+ (lastIdx = rowLength + rowState),
2194
+ lastIdx > chunk.length && (lastIdx = -1);
2195
+ }
2196
+ var offset = chunk.byteOffset + rowLength;
2197
+ if (-1 < lastIdx)
2198
+ (rowState = new Uint8Array(
2199
+ chunk.buffer,
2200
+ offset,
2201
+ lastIdx - rowLength
2202
+ )),
2203
+ processFullBinaryRow(response, rowID, i, buffer, rowState),
2204
+ (rowLength = lastIdx),
2205
+ 3 === chunkLength && rowLength++,
2206
+ (rowState = rowID = i = chunkLength = 0),
2207
+ (buffer.length = 0);
2208
+ else {
2209
+ chunk = new Uint8Array(
2210
+ chunk.buffer,
2211
+ offset,
2212
+ chunk.byteLength - rowLength
2213
+ );
2214
+ buffer.push(chunk);
2215
+ rowState -= chunk.byteLength;
2216
+ break;
2217
+ }
2122
2218
  }
2219
+ response._rowState = chunkLength;
2220
+ response._rowID = rowID;
2221
+ response._rowTag = i;
2222
+ response._rowLength = rowState;
2123
2223
  }
2124
- response._rowState = rowState;
2125
- response._rowID = rowID;
2126
- response._rowTag = rowTag;
2127
- response._rowLength = rowLength;
2128
2224
  });
2129
2225
  stream.on("error", function (error) {
2130
2226
  reportGlobalError(response, error);
@@ -1320,7 +1320,7 @@ function resolveTypedArray(
1320
1320
  );
1321
1321
  resolveBuffer(response, id, constructor);
1322
1322
  }
1323
- function processFullRow(response, id, tag, buffer, chunk) {
1323
+ function processFullBinaryRow(response, id, tag, buffer, chunk) {
1324
1324
  switch (tag) {
1325
1325
  case 65:
1326
1326
  resolveBuffer(response, id, mergeBuffer(buffer, chunk).buffer);
@@ -1373,6 +1373,9 @@ function processFullRow(response, id, tag, buffer, chunk) {
1373
1373
  )
1374
1374
  row += stringDecoder.decode(buffer[i], decoderOptions);
1375
1375
  row += stringDecoder.decode(chunk);
1376
+ processFullStringRow(response, id, tag, row);
1377
+ }
1378
+ function processFullStringRow(response, id, tag, row) {
1376
1379
  switch (tag) {
1377
1380
  case 73:
1378
1381
  resolveModule(response, id, row);
@@ -1429,14 +1432,15 @@ function processFullRow(response, id, tag, buffer, chunk) {
1429
1432
  row.stack = "Error: " + row.message;
1430
1433
  row.digest = tag;
1431
1434
  tag = response._chunks;
1432
- (buffer = tag.get(id))
1433
- ? triggerErrorOnChunk(buffer, row)
1435
+ var chunk = tag.get(id);
1436
+ chunk
1437
+ ? triggerErrorOnChunk(chunk, row)
1434
1438
  : tag.set(id, new Chunk("rejected", null, row, response));
1435
1439
  break;
1436
1440
  case 84:
1437
1441
  tag = response._chunks;
1438
- (buffer = tag.get(id)) && "pending" !== buffer.status
1439
- ? buffer.reason.enqueueValue(row)
1442
+ (chunk = tag.get(id)) && "pending" !== chunk.status
1443
+ ? chunk.reason.enqueueValue(row)
1440
1444
  : tag.set(id, new Chunk("fulfilled", row, null, response));
1441
1445
  break;
1442
1446
  case 68:
@@ -1463,8 +1467,8 @@ function processFullRow(response, id, tag, buffer, chunk) {
1463
1467
  break;
1464
1468
  default:
1465
1469
  (tag = response._chunks),
1466
- (buffer = tag.get(id))
1467
- ? resolveModelChunk(buffer, row)
1470
+ (chunk = tag.get(id))
1471
+ ? resolveModelChunk(chunk, row)
1468
1472
  : tag.set(id, new Chunk("resolved_model", row, null, response));
1469
1473
  }
1470
1474
  }
@@ -1518,82 +1522,175 @@ exports.createFromNodeStream = function (stream, ssrManifest, options) {
1518
1522
  void 0
1519
1523
  );
1520
1524
  stream.on("data", function (chunk) {
1521
- for (
1522
- var i = 0,
1523
- rowState = response._rowState,
1524
- rowID = response._rowID,
1525
- rowTag = response._rowTag,
1526
- rowLength = response._rowLength,
1527
- buffer = response._buffer,
1528
- chunkLength = chunk.length;
1529
- i < chunkLength;
1525
+ if ("string" === typeof chunk) {
1526
+ for (
1527
+ var i = 0,
1528
+ rowState = response._rowState,
1529
+ rowID = response._rowID,
1530
+ rowTag = response._rowTag,
1531
+ rowLength = response._rowLength,
1532
+ buffer = response._buffer,
1533
+ chunkLength = chunk.length;
1534
+ i < chunkLength;
1530
1535
 
1531
- ) {
1532
- var lastIdx = -1;
1533
- switch (rowState) {
1534
- case 0:
1535
- lastIdx = chunk[i++];
1536
- 58 === lastIdx
1537
- ? (rowState = 1)
1538
- : (rowID =
1539
- (rowID << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
1540
- continue;
1541
- case 1:
1542
- rowState = chunk[i];
1543
- 84 === rowState ||
1544
- 65 === rowState ||
1545
- 79 === rowState ||
1546
- 111 === rowState ||
1547
- 85 === rowState ||
1548
- 83 === rowState ||
1549
- 115 === rowState ||
1550
- 76 === rowState ||
1551
- 108 === rowState ||
1552
- 71 === rowState ||
1553
- 103 === rowState ||
1554
- 77 === rowState ||
1555
- 109 === rowState ||
1556
- 86 === rowState
1557
- ? ((rowTag = rowState), (rowState = 2), i++)
1558
- : (64 < rowState && 91 > rowState) ||
1559
- 114 === rowState ||
1560
- 120 === rowState
1561
- ? ((rowTag = rowState), (rowState = 3), i++)
1562
- : ((rowTag = 0), (rowState = 3));
1563
- continue;
1564
- case 2:
1565
- lastIdx = chunk[i++];
1566
- 44 === lastIdx
1567
- ? (rowState = 4)
1568
- : (rowLength =
1569
- (rowLength << 4) |
1570
- (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
1571
- continue;
1572
- case 3:
1573
- lastIdx = chunk.indexOf(10, i);
1574
- break;
1575
- case 4:
1576
- (lastIdx = i + rowLength), lastIdx > chunk.length && (lastIdx = -1);
1536
+ ) {
1537
+ var lastIdx = -1;
1538
+ switch (rowState) {
1539
+ case 0:
1540
+ lastIdx = chunk.charCodeAt(i++);
1541
+ 58 === lastIdx
1542
+ ? (rowState = 1)
1543
+ : (rowID =
1544
+ (rowID << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
1545
+ continue;
1546
+ case 1:
1547
+ rowState = chunk.charCodeAt(i);
1548
+ 84 === rowState ||
1549
+ 65 === rowState ||
1550
+ 79 === rowState ||
1551
+ 111 === rowState ||
1552
+ 85 === rowState ||
1553
+ 83 === rowState ||
1554
+ 115 === rowState ||
1555
+ 76 === rowState ||
1556
+ 108 === rowState ||
1557
+ 71 === rowState ||
1558
+ 103 === rowState ||
1559
+ 77 === rowState ||
1560
+ 109 === rowState ||
1561
+ 86 === rowState
1562
+ ? ((rowTag = rowState), (rowState = 2), i++)
1563
+ : (64 < rowState && 91 > rowState) ||
1564
+ 114 === rowState ||
1565
+ 120 === rowState
1566
+ ? ((rowTag = rowState), (rowState = 3), i++)
1567
+ : ((rowTag = 0), (rowState = 3));
1568
+ continue;
1569
+ case 2:
1570
+ lastIdx = chunk.charCodeAt(i++);
1571
+ 44 === lastIdx
1572
+ ? (rowState = 4)
1573
+ : (rowLength =
1574
+ (rowLength << 4) |
1575
+ (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
1576
+ continue;
1577
+ case 3:
1578
+ lastIdx = chunk.indexOf("\n", i);
1579
+ break;
1580
+ case 4:
1581
+ if (84 !== rowTag)
1582
+ throw Error(
1583
+ "Binary RSC chunks cannot be encoded as strings. This is a bug in the wiring of the React streams."
1584
+ );
1585
+ if (rowLength < chunk.length || chunk.length > 3 * rowLength)
1586
+ throw Error(
1587
+ "String chunks need to be passed in their original shape. Not split into smaller string chunks. This is a bug in the wiring of the React streams."
1588
+ );
1589
+ lastIdx = chunk.length;
1590
+ }
1591
+ if (-1 < lastIdx) {
1592
+ if (0 < buffer.length)
1593
+ throw Error(
1594
+ "String chunks need to be passed in their original shape. Not split into smaller string chunks. This is a bug in the wiring of the React streams."
1595
+ );
1596
+ i = chunk.slice(i, lastIdx);
1597
+ processFullStringRow(response, rowID, rowTag, i);
1598
+ i = lastIdx;
1599
+ 3 === rowState && i++;
1600
+ rowLength = rowID = rowTag = rowState = 0;
1601
+ buffer.length = 0;
1602
+ } else if (chunk.length !== i)
1603
+ throw Error(
1604
+ "String chunks need to be passed in their original shape. Not split into smaller string chunks. This is a bug in the wiring of the React streams."
1605
+ );
1577
1606
  }
1578
- var offset = chunk.byteOffset + i;
1579
- if (-1 < lastIdx)
1580
- (rowLength = new Uint8Array(chunk.buffer, offset, lastIdx - i)),
1581
- processFullRow(response, rowID, rowTag, buffer, rowLength),
1582
- (i = lastIdx),
1583
- 3 === rowState && i++,
1584
- (rowLength = rowID = rowTag = rowState = 0),
1585
- (buffer.length = 0);
1586
- else {
1587
- chunk = new Uint8Array(chunk.buffer, offset, chunk.byteLength - i);
1588
- buffer.push(chunk);
1589
- rowLength -= chunk.byteLength;
1590
- break;
1607
+ response._rowState = rowState;
1608
+ response._rowID = rowID;
1609
+ response._rowTag = rowTag;
1610
+ response._rowLength = rowLength;
1611
+ } else {
1612
+ rowLength = 0;
1613
+ chunkLength = response._rowState;
1614
+ rowID = response._rowID;
1615
+ i = response._rowTag;
1616
+ rowState = response._rowLength;
1617
+ buffer = response._buffer;
1618
+ for (rowTag = chunk.length; rowLength < rowTag; ) {
1619
+ lastIdx = -1;
1620
+ switch (chunkLength) {
1621
+ case 0:
1622
+ lastIdx = chunk[rowLength++];
1623
+ 58 === lastIdx
1624
+ ? (chunkLength = 1)
1625
+ : (rowID =
1626
+ (rowID << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
1627
+ continue;
1628
+ case 1:
1629
+ chunkLength = chunk[rowLength];
1630
+ 84 === chunkLength ||
1631
+ 65 === chunkLength ||
1632
+ 79 === chunkLength ||
1633
+ 111 === chunkLength ||
1634
+ 85 === chunkLength ||
1635
+ 83 === chunkLength ||
1636
+ 115 === chunkLength ||
1637
+ 76 === chunkLength ||
1638
+ 108 === chunkLength ||
1639
+ 71 === chunkLength ||
1640
+ 103 === chunkLength ||
1641
+ 77 === chunkLength ||
1642
+ 109 === chunkLength ||
1643
+ 86 === chunkLength
1644
+ ? ((i = chunkLength), (chunkLength = 2), rowLength++)
1645
+ : (64 < chunkLength && 91 > chunkLength) ||
1646
+ 114 === chunkLength ||
1647
+ 120 === chunkLength
1648
+ ? ((i = chunkLength), (chunkLength = 3), rowLength++)
1649
+ : ((i = 0), (chunkLength = 3));
1650
+ continue;
1651
+ case 2:
1652
+ lastIdx = chunk[rowLength++];
1653
+ 44 === lastIdx
1654
+ ? (chunkLength = 4)
1655
+ : (rowState =
1656
+ (rowState << 4) |
1657
+ (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
1658
+ continue;
1659
+ case 3:
1660
+ lastIdx = chunk.indexOf(10, rowLength);
1661
+ break;
1662
+ case 4:
1663
+ (lastIdx = rowLength + rowState),
1664
+ lastIdx > chunk.length && (lastIdx = -1);
1665
+ }
1666
+ var offset = chunk.byteOffset + rowLength;
1667
+ if (-1 < lastIdx)
1668
+ (rowState = new Uint8Array(
1669
+ chunk.buffer,
1670
+ offset,
1671
+ lastIdx - rowLength
1672
+ )),
1673
+ processFullBinaryRow(response, rowID, i, buffer, rowState),
1674
+ (rowLength = lastIdx),
1675
+ 3 === chunkLength && rowLength++,
1676
+ (rowState = rowID = i = chunkLength = 0),
1677
+ (buffer.length = 0);
1678
+ else {
1679
+ chunk = new Uint8Array(
1680
+ chunk.buffer,
1681
+ offset,
1682
+ chunk.byteLength - rowLength
1683
+ );
1684
+ buffer.push(chunk);
1685
+ rowState -= chunk.byteLength;
1686
+ break;
1687
+ }
1591
1688
  }
1689
+ response._rowState = chunkLength;
1690
+ response._rowID = rowID;
1691
+ response._rowTag = i;
1692
+ response._rowLength = rowState;
1592
1693
  }
1593
- response._rowState = rowState;
1594
- response._rowID = rowID;
1595
- response._rowTag = rowTag;
1596
- response._rowLength = rowLength;
1597
1694
  });
1598
1695
  stream.on("error", function (error) {
1599
1696
  reportGlobalError(response, error);