@uniformdev/next-app-router 20.72.3-alpha.5 → 20.72.3-alpha.8
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/handler.js +9 -12
- package/dist/handler.mjs +9 -12
- package/dist/index.esm.js +9 -12
- package/dist/index.js +9 -12
- package/dist/index.mjs +9 -12
- package/dist/middleware.js +7 -7
- package/dist/middleware.mjs +7 -7
- package/package.json +8 -8
package/dist/handler.js
CHANGED
|
@@ -1528,9 +1528,9 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1528
1528
|
let bufferStartIndex = 0;
|
|
1529
1529
|
let bufferEndIndex = 0;
|
|
1530
1530
|
let tokenCount = 0;
|
|
1531
|
-
const handleToken = (token, type) => {
|
|
1531
|
+
const handleToken = (token, type, offset) => {
|
|
1532
1532
|
tokenCount++;
|
|
1533
|
-
return onToken == null ? void 0 : onToken(token, type);
|
|
1533
|
+
return onToken == null ? void 0 : onToken(token, type, offset);
|
|
1534
1534
|
};
|
|
1535
1535
|
let state = "text";
|
|
1536
1536
|
for (let index = 0; index < serialized.length; index++) {
|
|
@@ -1541,7 +1541,7 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1541
1541
|
if (char === variablePrefix[0] && serialized[index + 1] === variablePrefix[1]) {
|
|
1542
1542
|
if (serialized[index - 1] === escapeCharacter) {
|
|
1543
1543
|
bufferEndIndex -= escapeCharacter.length;
|
|
1544
|
-
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text") === false) {
|
|
1544
|
+
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text", bufferStartIndex) === false) {
|
|
1545
1545
|
return tokenCount;
|
|
1546
1546
|
}
|
|
1547
1547
|
bufferStartIndex = index;
|
|
@@ -1550,12 +1550,12 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1550
1550
|
}
|
|
1551
1551
|
if (state === "variable") {
|
|
1552
1552
|
const textStart = bufferStartIndex - variablePrefix.length;
|
|
1553
|
-
if (handleToken(serialized.substring(textStart, bufferEndIndex), "text") === false) {
|
|
1553
|
+
if (handleToken(serialized.substring(textStart, bufferEndIndex), "text", textStart) === false) {
|
|
1554
1554
|
return tokenCount;
|
|
1555
1555
|
}
|
|
1556
1556
|
bufferStartIndex = bufferEndIndex;
|
|
1557
1557
|
} else if (bufferEndIndex > bufferStartIndex) {
|
|
1558
|
-
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text") === false) {
|
|
1558
|
+
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text", bufferStartIndex) === false) {
|
|
1559
1559
|
return tokenCount;
|
|
1560
1560
|
}
|
|
1561
1561
|
bufferStartIndex = bufferEndIndex;
|
|
@@ -1573,7 +1573,7 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1573
1573
|
state = "text";
|
|
1574
1574
|
if (bufferEndIndex > bufferStartIndex) {
|
|
1575
1575
|
const unescapedVariableName = serialized.substring(bufferStartIndex, bufferEndIndex).replace(/\\([${}])/g, "$1");
|
|
1576
|
-
if (handleToken(unescapedVariableName, "variable") === false) {
|
|
1576
|
+
if (handleToken(unescapedVariableName, "variable", bufferStartIndex) === false) {
|
|
1577
1577
|
return tokenCount;
|
|
1578
1578
|
}
|
|
1579
1579
|
bufferStartIndex = bufferEndIndex + variableSuffix.length;
|
|
@@ -1587,7 +1587,7 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1587
1587
|
bufferStartIndex -= variablePrefix.length;
|
|
1588
1588
|
}
|
|
1589
1589
|
if (bufferStartIndex < serialized.length) {
|
|
1590
|
-
handleToken(serialized.substring(bufferStartIndex), state);
|
|
1590
|
+
handleToken(serialized.substring(bufferStartIndex), state, bufferStartIndex);
|
|
1591
1591
|
}
|
|
1592
1592
|
return tokenCount;
|
|
1593
1593
|
}
|
|
@@ -2429,18 +2429,15 @@ var _Route = class _Route2 {
|
|
|
2429
2429
|
*/
|
|
2430
2430
|
static splitFragment(path) {
|
|
2431
2431
|
let fragmentIndex = -1;
|
|
2432
|
-
|
|
2433
|
-
parseVariableExpression(path, (token, type) => {
|
|
2432
|
+
parseVariableExpression(path, (token, type, offset) => {
|
|
2434
2433
|
if (type === "variable") {
|
|
2435
|
-
length += createVariableReference(token).length;
|
|
2436
2434
|
return;
|
|
2437
2435
|
}
|
|
2438
2436
|
const hashOffset = token.indexOf("#");
|
|
2439
2437
|
if (hashOffset === -1) {
|
|
2440
|
-
length += token.length;
|
|
2441
2438
|
return;
|
|
2442
2439
|
}
|
|
2443
|
-
fragmentIndex =
|
|
2440
|
+
fragmentIndex = offset + hashOffset;
|
|
2444
2441
|
return false;
|
|
2445
2442
|
});
|
|
2446
2443
|
if (fragmentIndex === -1) {
|
package/dist/handler.mjs
CHANGED
|
@@ -1513,9 +1513,9 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1513
1513
|
let bufferStartIndex = 0;
|
|
1514
1514
|
let bufferEndIndex = 0;
|
|
1515
1515
|
let tokenCount = 0;
|
|
1516
|
-
const handleToken = (token, type) => {
|
|
1516
|
+
const handleToken = (token, type, offset) => {
|
|
1517
1517
|
tokenCount++;
|
|
1518
|
-
return onToken == null ? void 0 : onToken(token, type);
|
|
1518
|
+
return onToken == null ? void 0 : onToken(token, type, offset);
|
|
1519
1519
|
};
|
|
1520
1520
|
let state = "text";
|
|
1521
1521
|
for (let index = 0; index < serialized.length; index++) {
|
|
@@ -1526,7 +1526,7 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1526
1526
|
if (char === variablePrefix[0] && serialized[index + 1] === variablePrefix[1]) {
|
|
1527
1527
|
if (serialized[index - 1] === escapeCharacter) {
|
|
1528
1528
|
bufferEndIndex -= escapeCharacter.length;
|
|
1529
|
-
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text") === false) {
|
|
1529
|
+
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text", bufferStartIndex) === false) {
|
|
1530
1530
|
return tokenCount;
|
|
1531
1531
|
}
|
|
1532
1532
|
bufferStartIndex = index;
|
|
@@ -1535,12 +1535,12 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1535
1535
|
}
|
|
1536
1536
|
if (state === "variable") {
|
|
1537
1537
|
const textStart = bufferStartIndex - variablePrefix.length;
|
|
1538
|
-
if (handleToken(serialized.substring(textStart, bufferEndIndex), "text") === false) {
|
|
1538
|
+
if (handleToken(serialized.substring(textStart, bufferEndIndex), "text", textStart) === false) {
|
|
1539
1539
|
return tokenCount;
|
|
1540
1540
|
}
|
|
1541
1541
|
bufferStartIndex = bufferEndIndex;
|
|
1542
1542
|
} else if (bufferEndIndex > bufferStartIndex) {
|
|
1543
|
-
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text") === false) {
|
|
1543
|
+
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text", bufferStartIndex) === false) {
|
|
1544
1544
|
return tokenCount;
|
|
1545
1545
|
}
|
|
1546
1546
|
bufferStartIndex = bufferEndIndex;
|
|
@@ -1558,7 +1558,7 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1558
1558
|
state = "text";
|
|
1559
1559
|
if (bufferEndIndex > bufferStartIndex) {
|
|
1560
1560
|
const unescapedVariableName = serialized.substring(bufferStartIndex, bufferEndIndex).replace(/\\([${}])/g, "$1");
|
|
1561
|
-
if (handleToken(unescapedVariableName, "variable") === false) {
|
|
1561
|
+
if (handleToken(unescapedVariableName, "variable", bufferStartIndex) === false) {
|
|
1562
1562
|
return tokenCount;
|
|
1563
1563
|
}
|
|
1564
1564
|
bufferStartIndex = bufferEndIndex + variableSuffix.length;
|
|
@@ -1572,7 +1572,7 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1572
1572
|
bufferStartIndex -= variablePrefix.length;
|
|
1573
1573
|
}
|
|
1574
1574
|
if (bufferStartIndex < serialized.length) {
|
|
1575
|
-
handleToken(serialized.substring(bufferStartIndex), state);
|
|
1575
|
+
handleToken(serialized.substring(bufferStartIndex), state, bufferStartIndex);
|
|
1576
1576
|
}
|
|
1577
1577
|
return tokenCount;
|
|
1578
1578
|
}
|
|
@@ -2414,18 +2414,15 @@ var _Route = class _Route2 {
|
|
|
2414
2414
|
*/
|
|
2415
2415
|
static splitFragment(path) {
|
|
2416
2416
|
let fragmentIndex = -1;
|
|
2417
|
-
|
|
2418
|
-
parseVariableExpression(path, (token, type) => {
|
|
2417
|
+
parseVariableExpression(path, (token, type, offset) => {
|
|
2419
2418
|
if (type === "variable") {
|
|
2420
|
-
length += createVariableReference(token).length;
|
|
2421
2419
|
return;
|
|
2422
2420
|
}
|
|
2423
2421
|
const hashOffset = token.indexOf("#");
|
|
2424
2422
|
if (hashOffset === -1) {
|
|
2425
|
-
length += token.length;
|
|
2426
2423
|
return;
|
|
2427
2424
|
}
|
|
2428
|
-
fragmentIndex =
|
|
2425
|
+
fragmentIndex = offset + hashOffset;
|
|
2429
2426
|
return false;
|
|
2430
2427
|
});
|
|
2431
2428
|
if (fragmentIndex === -1) {
|
package/dist/index.esm.js
CHANGED
|
@@ -1563,9 +1563,9 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1563
1563
|
let bufferStartIndex = 0;
|
|
1564
1564
|
let bufferEndIndex = 0;
|
|
1565
1565
|
let tokenCount = 0;
|
|
1566
|
-
const handleToken = (token, type) => {
|
|
1566
|
+
const handleToken = (token, type, offset) => {
|
|
1567
1567
|
tokenCount++;
|
|
1568
|
-
return onToken == null ? void 0 : onToken(token, type);
|
|
1568
|
+
return onToken == null ? void 0 : onToken(token, type, offset);
|
|
1569
1569
|
};
|
|
1570
1570
|
let state = "text";
|
|
1571
1571
|
for (let index = 0; index < serialized.length; index++) {
|
|
@@ -1576,7 +1576,7 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1576
1576
|
if (char === variablePrefix[0] && serialized[index + 1] === variablePrefix[1]) {
|
|
1577
1577
|
if (serialized[index - 1] === escapeCharacter) {
|
|
1578
1578
|
bufferEndIndex -= escapeCharacter.length;
|
|
1579
|
-
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text") === false) {
|
|
1579
|
+
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text", bufferStartIndex) === false) {
|
|
1580
1580
|
return tokenCount;
|
|
1581
1581
|
}
|
|
1582
1582
|
bufferStartIndex = index;
|
|
@@ -1585,12 +1585,12 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1585
1585
|
}
|
|
1586
1586
|
if (state === "variable") {
|
|
1587
1587
|
const textStart = bufferStartIndex - variablePrefix.length;
|
|
1588
|
-
if (handleToken(serialized.substring(textStart, bufferEndIndex), "text") === false) {
|
|
1588
|
+
if (handleToken(serialized.substring(textStart, bufferEndIndex), "text", textStart) === false) {
|
|
1589
1589
|
return tokenCount;
|
|
1590
1590
|
}
|
|
1591
1591
|
bufferStartIndex = bufferEndIndex;
|
|
1592
1592
|
} else if (bufferEndIndex > bufferStartIndex) {
|
|
1593
|
-
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text") === false) {
|
|
1593
|
+
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text", bufferStartIndex) === false) {
|
|
1594
1594
|
return tokenCount;
|
|
1595
1595
|
}
|
|
1596
1596
|
bufferStartIndex = bufferEndIndex;
|
|
@@ -1608,7 +1608,7 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1608
1608
|
state = "text";
|
|
1609
1609
|
if (bufferEndIndex > bufferStartIndex) {
|
|
1610
1610
|
const unescapedVariableName = serialized.substring(bufferStartIndex, bufferEndIndex).replace(/\\([${}])/g, "$1");
|
|
1611
|
-
if (handleToken(unescapedVariableName, "variable") === false) {
|
|
1611
|
+
if (handleToken(unescapedVariableName, "variable", bufferStartIndex) === false) {
|
|
1612
1612
|
return tokenCount;
|
|
1613
1613
|
}
|
|
1614
1614
|
bufferStartIndex = bufferEndIndex + variableSuffix.length;
|
|
@@ -1622,7 +1622,7 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1622
1622
|
bufferStartIndex -= variablePrefix.length;
|
|
1623
1623
|
}
|
|
1624
1624
|
if (bufferStartIndex < serialized.length) {
|
|
1625
|
-
handleToken(serialized.substring(bufferStartIndex), state);
|
|
1625
|
+
handleToken(serialized.substring(bufferStartIndex), state, bufferStartIndex);
|
|
1626
1626
|
}
|
|
1627
1627
|
return tokenCount;
|
|
1628
1628
|
}
|
|
@@ -2712,18 +2712,15 @@ var _Route = class _Route2 {
|
|
|
2712
2712
|
*/
|
|
2713
2713
|
static splitFragment(path) {
|
|
2714
2714
|
let fragmentIndex = -1;
|
|
2715
|
-
|
|
2716
|
-
parseVariableExpression(path, (token, type) => {
|
|
2715
|
+
parseVariableExpression(path, (token, type, offset) => {
|
|
2717
2716
|
if (type === "variable") {
|
|
2718
|
-
length += createVariableReference(token).length;
|
|
2719
2717
|
return;
|
|
2720
2718
|
}
|
|
2721
2719
|
const hashOffset = token.indexOf("#");
|
|
2722
2720
|
if (hashOffset === -1) {
|
|
2723
|
-
length += token.length;
|
|
2724
2721
|
return;
|
|
2725
2722
|
}
|
|
2726
|
-
fragmentIndex =
|
|
2723
|
+
fragmentIndex = offset + hashOffset;
|
|
2727
2724
|
return false;
|
|
2728
2725
|
});
|
|
2729
2726
|
if (fragmentIndex === -1) {
|
package/dist/index.js
CHANGED
|
@@ -1590,9 +1590,9 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1590
1590
|
let bufferStartIndex = 0;
|
|
1591
1591
|
let bufferEndIndex = 0;
|
|
1592
1592
|
let tokenCount = 0;
|
|
1593
|
-
const handleToken = (token, type) => {
|
|
1593
|
+
const handleToken = (token, type, offset) => {
|
|
1594
1594
|
tokenCount++;
|
|
1595
|
-
return onToken == null ? void 0 : onToken(token, type);
|
|
1595
|
+
return onToken == null ? void 0 : onToken(token, type, offset);
|
|
1596
1596
|
};
|
|
1597
1597
|
let state = "text";
|
|
1598
1598
|
for (let index = 0; index < serialized.length; index++) {
|
|
@@ -1603,7 +1603,7 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1603
1603
|
if (char === variablePrefix[0] && serialized[index + 1] === variablePrefix[1]) {
|
|
1604
1604
|
if (serialized[index - 1] === escapeCharacter) {
|
|
1605
1605
|
bufferEndIndex -= escapeCharacter.length;
|
|
1606
|
-
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text") === false) {
|
|
1606
|
+
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text", bufferStartIndex) === false) {
|
|
1607
1607
|
return tokenCount;
|
|
1608
1608
|
}
|
|
1609
1609
|
bufferStartIndex = index;
|
|
@@ -1612,12 +1612,12 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1612
1612
|
}
|
|
1613
1613
|
if (state === "variable") {
|
|
1614
1614
|
const textStart = bufferStartIndex - variablePrefix.length;
|
|
1615
|
-
if (handleToken(serialized.substring(textStart, bufferEndIndex), "text") === false) {
|
|
1615
|
+
if (handleToken(serialized.substring(textStart, bufferEndIndex), "text", textStart) === false) {
|
|
1616
1616
|
return tokenCount;
|
|
1617
1617
|
}
|
|
1618
1618
|
bufferStartIndex = bufferEndIndex;
|
|
1619
1619
|
} else if (bufferEndIndex > bufferStartIndex) {
|
|
1620
|
-
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text") === false) {
|
|
1620
|
+
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text", bufferStartIndex) === false) {
|
|
1621
1621
|
return tokenCount;
|
|
1622
1622
|
}
|
|
1623
1623
|
bufferStartIndex = bufferEndIndex;
|
|
@@ -1635,7 +1635,7 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1635
1635
|
state = "text";
|
|
1636
1636
|
if (bufferEndIndex > bufferStartIndex) {
|
|
1637
1637
|
const unescapedVariableName = serialized.substring(bufferStartIndex, bufferEndIndex).replace(/\\([${}])/g, "$1");
|
|
1638
|
-
if (handleToken(unescapedVariableName, "variable") === false) {
|
|
1638
|
+
if (handleToken(unescapedVariableName, "variable", bufferStartIndex) === false) {
|
|
1639
1639
|
return tokenCount;
|
|
1640
1640
|
}
|
|
1641
1641
|
bufferStartIndex = bufferEndIndex + variableSuffix.length;
|
|
@@ -1649,7 +1649,7 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1649
1649
|
bufferStartIndex -= variablePrefix.length;
|
|
1650
1650
|
}
|
|
1651
1651
|
if (bufferStartIndex < serialized.length) {
|
|
1652
|
-
handleToken(serialized.substring(bufferStartIndex), state);
|
|
1652
|
+
handleToken(serialized.substring(bufferStartIndex), state, bufferStartIndex);
|
|
1653
1653
|
}
|
|
1654
1654
|
return tokenCount;
|
|
1655
1655
|
}
|
|
@@ -2739,18 +2739,15 @@ var _Route = class _Route2 {
|
|
|
2739
2739
|
*/
|
|
2740
2740
|
static splitFragment(path) {
|
|
2741
2741
|
let fragmentIndex = -1;
|
|
2742
|
-
|
|
2743
|
-
parseVariableExpression(path, (token, type) => {
|
|
2742
|
+
parseVariableExpression(path, (token, type, offset) => {
|
|
2744
2743
|
if (type === "variable") {
|
|
2745
|
-
length += createVariableReference(token).length;
|
|
2746
2744
|
return;
|
|
2747
2745
|
}
|
|
2748
2746
|
const hashOffset = token.indexOf("#");
|
|
2749
2747
|
if (hashOffset === -1) {
|
|
2750
|
-
length += token.length;
|
|
2751
2748
|
return;
|
|
2752
2749
|
}
|
|
2753
|
-
fragmentIndex =
|
|
2750
|
+
fragmentIndex = offset + hashOffset;
|
|
2754
2751
|
return false;
|
|
2755
2752
|
});
|
|
2756
2753
|
if (fragmentIndex === -1) {
|
package/dist/index.mjs
CHANGED
|
@@ -1563,9 +1563,9 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1563
1563
|
let bufferStartIndex = 0;
|
|
1564
1564
|
let bufferEndIndex = 0;
|
|
1565
1565
|
let tokenCount = 0;
|
|
1566
|
-
const handleToken = (token, type) => {
|
|
1566
|
+
const handleToken = (token, type, offset) => {
|
|
1567
1567
|
tokenCount++;
|
|
1568
|
-
return onToken == null ? void 0 : onToken(token, type);
|
|
1568
|
+
return onToken == null ? void 0 : onToken(token, type, offset);
|
|
1569
1569
|
};
|
|
1570
1570
|
let state = "text";
|
|
1571
1571
|
for (let index = 0; index < serialized.length; index++) {
|
|
@@ -1576,7 +1576,7 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1576
1576
|
if (char === variablePrefix[0] && serialized[index + 1] === variablePrefix[1]) {
|
|
1577
1577
|
if (serialized[index - 1] === escapeCharacter) {
|
|
1578
1578
|
bufferEndIndex -= escapeCharacter.length;
|
|
1579
|
-
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text") === false) {
|
|
1579
|
+
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text", bufferStartIndex) === false) {
|
|
1580
1580
|
return tokenCount;
|
|
1581
1581
|
}
|
|
1582
1582
|
bufferStartIndex = index;
|
|
@@ -1585,12 +1585,12 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1585
1585
|
}
|
|
1586
1586
|
if (state === "variable") {
|
|
1587
1587
|
const textStart = bufferStartIndex - variablePrefix.length;
|
|
1588
|
-
if (handleToken(serialized.substring(textStart, bufferEndIndex), "text") === false) {
|
|
1588
|
+
if (handleToken(serialized.substring(textStart, bufferEndIndex), "text", textStart) === false) {
|
|
1589
1589
|
return tokenCount;
|
|
1590
1590
|
}
|
|
1591
1591
|
bufferStartIndex = bufferEndIndex;
|
|
1592
1592
|
} else if (bufferEndIndex > bufferStartIndex) {
|
|
1593
|
-
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text") === false) {
|
|
1593
|
+
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text", bufferStartIndex) === false) {
|
|
1594
1594
|
return tokenCount;
|
|
1595
1595
|
}
|
|
1596
1596
|
bufferStartIndex = bufferEndIndex;
|
|
@@ -1608,7 +1608,7 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1608
1608
|
state = "text";
|
|
1609
1609
|
if (bufferEndIndex > bufferStartIndex) {
|
|
1610
1610
|
const unescapedVariableName = serialized.substring(bufferStartIndex, bufferEndIndex).replace(/\\([${}])/g, "$1");
|
|
1611
|
-
if (handleToken(unescapedVariableName, "variable") === false) {
|
|
1611
|
+
if (handleToken(unescapedVariableName, "variable", bufferStartIndex) === false) {
|
|
1612
1612
|
return tokenCount;
|
|
1613
1613
|
}
|
|
1614
1614
|
bufferStartIndex = bufferEndIndex + variableSuffix.length;
|
|
@@ -1622,7 +1622,7 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1622
1622
|
bufferStartIndex -= variablePrefix.length;
|
|
1623
1623
|
}
|
|
1624
1624
|
if (bufferStartIndex < serialized.length) {
|
|
1625
|
-
handleToken(serialized.substring(bufferStartIndex), state);
|
|
1625
|
+
handleToken(serialized.substring(bufferStartIndex), state, bufferStartIndex);
|
|
1626
1626
|
}
|
|
1627
1627
|
return tokenCount;
|
|
1628
1628
|
}
|
|
@@ -2712,18 +2712,15 @@ var _Route = class _Route2 {
|
|
|
2712
2712
|
*/
|
|
2713
2713
|
static splitFragment(path) {
|
|
2714
2714
|
let fragmentIndex = -1;
|
|
2715
|
-
|
|
2716
|
-
parseVariableExpression(path, (token, type) => {
|
|
2715
|
+
parseVariableExpression(path, (token, type, offset) => {
|
|
2717
2716
|
if (type === "variable") {
|
|
2718
|
-
length += createVariableReference(token).length;
|
|
2719
2717
|
return;
|
|
2720
2718
|
}
|
|
2721
2719
|
const hashOffset = token.indexOf("#");
|
|
2722
2720
|
if (hashOffset === -1) {
|
|
2723
|
-
length += token.length;
|
|
2724
2721
|
return;
|
|
2725
2722
|
}
|
|
2726
|
-
fragmentIndex =
|
|
2723
|
+
fragmentIndex = offset + hashOffset;
|
|
2727
2724
|
return false;
|
|
2728
2725
|
});
|
|
2729
2726
|
if (fragmentIndex === -1) {
|
package/dist/middleware.js
CHANGED
|
@@ -1759,9 +1759,9 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1759
1759
|
let bufferStartIndex = 0;
|
|
1760
1760
|
let bufferEndIndex = 0;
|
|
1761
1761
|
let tokenCount = 0;
|
|
1762
|
-
const handleToken = (token, type) => {
|
|
1762
|
+
const handleToken = (token, type, offset) => {
|
|
1763
1763
|
tokenCount++;
|
|
1764
|
-
return onToken == null ? void 0 : onToken(token, type);
|
|
1764
|
+
return onToken == null ? void 0 : onToken(token, type, offset);
|
|
1765
1765
|
};
|
|
1766
1766
|
let state = "text";
|
|
1767
1767
|
for (let index = 0; index < serialized.length; index++) {
|
|
@@ -1772,7 +1772,7 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1772
1772
|
if (char === variablePrefix[0] && serialized[index + 1] === variablePrefix[1]) {
|
|
1773
1773
|
if (serialized[index - 1] === escapeCharacter) {
|
|
1774
1774
|
bufferEndIndex -= escapeCharacter.length;
|
|
1775
|
-
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text") === false) {
|
|
1775
|
+
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text", bufferStartIndex) === false) {
|
|
1776
1776
|
return tokenCount;
|
|
1777
1777
|
}
|
|
1778
1778
|
bufferStartIndex = index;
|
|
@@ -1781,12 +1781,12 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1781
1781
|
}
|
|
1782
1782
|
if (state === "variable") {
|
|
1783
1783
|
const textStart = bufferStartIndex - variablePrefix.length;
|
|
1784
|
-
if (handleToken(serialized.substring(textStart, bufferEndIndex), "text") === false) {
|
|
1784
|
+
if (handleToken(serialized.substring(textStart, bufferEndIndex), "text", textStart) === false) {
|
|
1785
1785
|
return tokenCount;
|
|
1786
1786
|
}
|
|
1787
1787
|
bufferStartIndex = bufferEndIndex;
|
|
1788
1788
|
} else if (bufferEndIndex > bufferStartIndex) {
|
|
1789
|
-
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text") === false) {
|
|
1789
|
+
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text", bufferStartIndex) === false) {
|
|
1790
1790
|
return tokenCount;
|
|
1791
1791
|
}
|
|
1792
1792
|
bufferStartIndex = bufferEndIndex;
|
|
@@ -1804,7 +1804,7 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1804
1804
|
state = "text";
|
|
1805
1805
|
if (bufferEndIndex > bufferStartIndex) {
|
|
1806
1806
|
const unescapedVariableName = serialized.substring(bufferStartIndex, bufferEndIndex).replace(/\\([${}])/g, "$1");
|
|
1807
|
-
if (handleToken(unescapedVariableName, "variable") === false) {
|
|
1807
|
+
if (handleToken(unescapedVariableName, "variable", bufferStartIndex) === false) {
|
|
1808
1808
|
return tokenCount;
|
|
1809
1809
|
}
|
|
1810
1810
|
bufferStartIndex = bufferEndIndex + variableSuffix.length;
|
|
@@ -1818,7 +1818,7 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1818
1818
|
bufferStartIndex -= variablePrefix.length;
|
|
1819
1819
|
}
|
|
1820
1820
|
if (bufferStartIndex < serialized.length) {
|
|
1821
|
-
handleToken(serialized.substring(bufferStartIndex), state);
|
|
1821
|
+
handleToken(serialized.substring(bufferStartIndex), state, bufferStartIndex);
|
|
1822
1822
|
}
|
|
1823
1823
|
return tokenCount;
|
|
1824
1824
|
}
|
package/dist/middleware.mjs
CHANGED
|
@@ -1744,9 +1744,9 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1744
1744
|
let bufferStartIndex = 0;
|
|
1745
1745
|
let bufferEndIndex = 0;
|
|
1746
1746
|
let tokenCount = 0;
|
|
1747
|
-
const handleToken = (token, type) => {
|
|
1747
|
+
const handleToken = (token, type, offset) => {
|
|
1748
1748
|
tokenCount++;
|
|
1749
|
-
return onToken == null ? void 0 : onToken(token, type);
|
|
1749
|
+
return onToken == null ? void 0 : onToken(token, type, offset);
|
|
1750
1750
|
};
|
|
1751
1751
|
let state = "text";
|
|
1752
1752
|
for (let index = 0; index < serialized.length; index++) {
|
|
@@ -1757,7 +1757,7 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1757
1757
|
if (char === variablePrefix[0] && serialized[index + 1] === variablePrefix[1]) {
|
|
1758
1758
|
if (serialized[index - 1] === escapeCharacter) {
|
|
1759
1759
|
bufferEndIndex -= escapeCharacter.length;
|
|
1760
|
-
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text") === false) {
|
|
1760
|
+
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text", bufferStartIndex) === false) {
|
|
1761
1761
|
return tokenCount;
|
|
1762
1762
|
}
|
|
1763
1763
|
bufferStartIndex = index;
|
|
@@ -1766,12 +1766,12 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1766
1766
|
}
|
|
1767
1767
|
if (state === "variable") {
|
|
1768
1768
|
const textStart = bufferStartIndex - variablePrefix.length;
|
|
1769
|
-
if (handleToken(serialized.substring(textStart, bufferEndIndex), "text") === false) {
|
|
1769
|
+
if (handleToken(serialized.substring(textStart, bufferEndIndex), "text", textStart) === false) {
|
|
1770
1770
|
return tokenCount;
|
|
1771
1771
|
}
|
|
1772
1772
|
bufferStartIndex = bufferEndIndex;
|
|
1773
1773
|
} else if (bufferEndIndex > bufferStartIndex) {
|
|
1774
|
-
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text") === false) {
|
|
1774
|
+
if (handleToken(serialized.substring(bufferStartIndex, bufferEndIndex), "text", bufferStartIndex) === false) {
|
|
1775
1775
|
return tokenCount;
|
|
1776
1776
|
}
|
|
1777
1777
|
bufferStartIndex = bufferEndIndex;
|
|
@@ -1789,7 +1789,7 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1789
1789
|
state = "text";
|
|
1790
1790
|
if (bufferEndIndex > bufferStartIndex) {
|
|
1791
1791
|
const unescapedVariableName = serialized.substring(bufferStartIndex, bufferEndIndex).replace(/\\([${}])/g, "$1");
|
|
1792
|
-
if (handleToken(unescapedVariableName, "variable") === false) {
|
|
1792
|
+
if (handleToken(unescapedVariableName, "variable", bufferStartIndex) === false) {
|
|
1793
1793
|
return tokenCount;
|
|
1794
1794
|
}
|
|
1795
1795
|
bufferStartIndex = bufferEndIndex + variableSuffix.length;
|
|
@@ -1803,7 +1803,7 @@ function parseVariableExpression(serialized, onToken) {
|
|
|
1803
1803
|
bufferStartIndex -= variablePrefix.length;
|
|
1804
1804
|
}
|
|
1805
1805
|
if (bufferStartIndex < serialized.length) {
|
|
1806
|
-
handleToken(serialized.substring(bufferStartIndex), state);
|
|
1806
|
+
handleToken(serialized.substring(bufferStartIndex), state, bufferStartIndex);
|
|
1807
1807
|
}
|
|
1808
1808
|
return tokenCount;
|
|
1809
1809
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/next-app-router",
|
|
3
|
-
"version": "20.72.3-alpha.
|
|
3
|
+
"version": "20.72.3-alpha.8+bc4cf36434",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
@@ -98,12 +98,12 @@
|
|
|
98
98
|
"vitest": "4.1.9"
|
|
99
99
|
},
|
|
100
100
|
"dependencies": {
|
|
101
|
-
"@uniformdev/canvas-react": "20.72.3-alpha.
|
|
102
|
-
"@uniformdev/next-app-router-client": "20.72.3-alpha.
|
|
103
|
-
"@uniformdev/next-app-router-shared": "20.72.3-alpha.
|
|
104
|
-
"@uniformdev/redirect": "20.72.3-alpha.
|
|
105
|
-
"@uniformdev/richtext": "20.72.3-alpha.
|
|
106
|
-
"@uniformdev/webhooks": "20.72.3-alpha.
|
|
101
|
+
"@uniformdev/canvas-react": "20.72.3-alpha.8+bc4cf36434",
|
|
102
|
+
"@uniformdev/next-app-router-client": "20.72.3-alpha.8+bc4cf36434",
|
|
103
|
+
"@uniformdev/next-app-router-shared": "20.72.3-alpha.8+bc4cf36434",
|
|
104
|
+
"@uniformdev/redirect": "20.72.3-alpha.8+bc4cf36434",
|
|
105
|
+
"@uniformdev/richtext": "20.72.3-alpha.8+bc4cf36434",
|
|
106
|
+
"@uniformdev/webhooks": "20.72.3-alpha.8+bc4cf36434",
|
|
107
107
|
"@vercel/functions": "^3.7.2",
|
|
108
108
|
"encoding": "^0.1.13",
|
|
109
109
|
"server-only": "^0.0.1",
|
|
@@ -120,5 +120,5 @@
|
|
|
120
120
|
"publishConfig": {
|
|
121
121
|
"access": "public"
|
|
122
122
|
},
|
|
123
|
-
"gitHead": "
|
|
123
|
+
"gitHead": "bc4cf3643488dcbc8929bbef6e554ca53de2dd37"
|
|
124
124
|
}
|