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.
- package/cjs/react-server-dom-webpack-client.browser.development.js +53 -50
- package/cjs/react-server-dom-webpack-client.browser.production.js +36 -34
- package/cjs/react-server-dom-webpack-client.edge.development.js +53 -50
- package/cjs/react-server-dom-webpack-client.edge.production.js +36 -34
- package/cjs/react-server-dom-webpack-client.node.development.js +181 -85
- package/cjs/react-server-dom-webpack-client.node.production.js +176 -79
- package/cjs/react-server-dom-webpack-client.node.unbundled.development.js +181 -85
- package/cjs/react-server-dom-webpack-client.node.unbundled.production.js +176 -79
- package/cjs/react-server-dom-webpack-server.node.development.js +1 -1
- package/cjs/react-server-dom-webpack-server.node.production.js +1 -1
- package/cjs/react-server-dom-webpack-server.node.unbundled.development.js +1 -1
- package/cjs/react-server-dom-webpack-server.node.unbundled.production.js +1 -1
- package/package.json +3 -3
@@ -1711,7 +1711,7 @@
|
|
1711
1711
|
);
|
1712
1712
|
resolveBuffer(response, id, constructor);
|
1713
1713
|
}
|
1714
|
-
function
|
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
|
-
|
1820
|
-
|
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 =
|
1827
|
-
row.environmentName =
|
1829
|
+
row.digest = digest;
|
1830
|
+
row.environmentName = env;
|
1828
1831
|
tag = response._chunks;
|
1829
|
-
(
|
1830
|
-
? triggerErrorOnChunk(
|
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
|
-
(
|
1836
|
-
?
|
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
|
-
(
|
1906
|
-
? resolveModelChunk(
|
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
|
-
|
2051
|
-
|
2052
|
-
|
2053
|
-
|
2054
|
-
|
2055
|
-
|
2056
|
-
|
2057
|
-
|
2058
|
-
|
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
|
-
|
2062
|
-
|
2063
|
-
|
2064
|
-
|
2065
|
-
|
2066
|
-
|
2067
|
-
|
2068
|
-
|
2069
|
-
|
2070
|
-
|
2071
|
-
|
2072
|
-
|
2073
|
-
|
2074
|
-
|
2075
|
-
|
2076
|
-
|
2077
|
-
|
2078
|
-
|
2079
|
-
|
2080
|
-
|
2081
|
-
|
2082
|
-
|
2083
|
-
|
2084
|
-
|
2085
|
-
|
2086
|
-
|
2087
|
-
|
2088
|
-
|
2089
|
-
|
2090
|
-
|
2091
|
-
|
2092
|
-
|
2093
|
-
|
2094
|
-
|
2095
|
-
|
2096
|
-
|
2097
|
-
|
2098
|
-
|
2099
|
-
|
2100
|
-
|
2101
|
-
|
2102
|
-
|
2103
|
-
|
2104
|
-
|
2105
|
-
|
2106
|
-
|
2107
|
-
|
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
|
-
|
2110
|
-
|
2111
|
-
|
2112
|
-
|
2113
|
-
|
2114
|
-
|
2115
|
-
|
2116
|
-
|
2117
|
-
|
2118
|
-
|
2119
|
-
|
2120
|
-
|
2121
|
-
|
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
|
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
|
-
|
1433
|
-
|
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
|
-
(
|
1439
|
-
?
|
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
|
-
(
|
1467
|
-
? resolveModelChunk(
|
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
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
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
|
-
|
1533
|
-
|
1534
|
-
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
|
1553
|
-
|
1554
|
-
|
1555
|
-
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1561
|
-
|
1562
|
-
|
1563
|
-
|
1564
|
-
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
1575
|
-
|
1576
|
-
|
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
|
-
|
1579
|
-
|
1580
|
-
|
1581
|
-
|
1582
|
-
|
1583
|
-
|
1584
|
-
|
1585
|
-
|
1586
|
-
|
1587
|
-
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
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);
|