@uniformdev/next-app-router 20.49.2 → 20.49.3
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/middleware.js +23 -0
- package/dist/middleware.mjs +23 -0
- package/package.json +8 -8
package/dist/middleware.js
CHANGED
|
@@ -2093,11 +2093,34 @@ var stringOperatorEvaluators = {
|
|
|
2093
2093
|
endswith: endsWithEvaluator,
|
|
2094
2094
|
empty: emptyEvaluator
|
|
2095
2095
|
};
|
|
2096
|
+
var numericOperatorEvaluators = {
|
|
2097
|
+
gt: (left, right) => left > right,
|
|
2098
|
+
lt: (left, right) => left < right
|
|
2099
|
+
};
|
|
2100
|
+
function evaluateNumericOperator(criteria, matchValue) {
|
|
2101
|
+
const { op, value } = criteria;
|
|
2102
|
+
const evaluator = numericOperatorEvaluators[op];
|
|
2103
|
+
if (!evaluator) {
|
|
2104
|
+
return null;
|
|
2105
|
+
}
|
|
2106
|
+
if (typeof matchValue === "string" && matchValue.trim() === "" || typeof value === "string" && value.trim() === "") {
|
|
2107
|
+
return false;
|
|
2108
|
+
}
|
|
2109
|
+
const leftNum = Number(matchValue);
|
|
2110
|
+
const rightNum = Number(value);
|
|
2111
|
+
if (isNaN(leftNum) || isNaN(rightNum)) {
|
|
2112
|
+
return false;
|
|
2113
|
+
}
|
|
2114
|
+
return evaluator(leftNum, rightNum);
|
|
2115
|
+
}
|
|
2096
2116
|
function evaluateStringMatch(criteria, matchValue, allow) {
|
|
2097
2117
|
const { op, value } = criteria;
|
|
2098
2118
|
if (allow && !allow.has(op)) {
|
|
2099
2119
|
return null;
|
|
2100
2120
|
}
|
|
2121
|
+
if (op in numericOperatorEvaluators) {
|
|
2122
|
+
return evaluateNumericOperator(criteria, matchValue);
|
|
2123
|
+
}
|
|
2101
2124
|
let opMatch = op;
|
|
2102
2125
|
const negation = op.startsWith("!");
|
|
2103
2126
|
if (negation) {
|
package/dist/middleware.mjs
CHANGED
|
@@ -2078,11 +2078,34 @@ var stringOperatorEvaluators = {
|
|
|
2078
2078
|
endswith: endsWithEvaluator,
|
|
2079
2079
|
empty: emptyEvaluator
|
|
2080
2080
|
};
|
|
2081
|
+
var numericOperatorEvaluators = {
|
|
2082
|
+
gt: (left, right) => left > right,
|
|
2083
|
+
lt: (left, right) => left < right
|
|
2084
|
+
};
|
|
2085
|
+
function evaluateNumericOperator(criteria, matchValue) {
|
|
2086
|
+
const { op, value } = criteria;
|
|
2087
|
+
const evaluator = numericOperatorEvaluators[op];
|
|
2088
|
+
if (!evaluator) {
|
|
2089
|
+
return null;
|
|
2090
|
+
}
|
|
2091
|
+
if (typeof matchValue === "string" && matchValue.trim() === "" || typeof value === "string" && value.trim() === "") {
|
|
2092
|
+
return false;
|
|
2093
|
+
}
|
|
2094
|
+
const leftNum = Number(matchValue);
|
|
2095
|
+
const rightNum = Number(value);
|
|
2096
|
+
if (isNaN(leftNum) || isNaN(rightNum)) {
|
|
2097
|
+
return false;
|
|
2098
|
+
}
|
|
2099
|
+
return evaluator(leftNum, rightNum);
|
|
2100
|
+
}
|
|
2081
2101
|
function evaluateStringMatch(criteria, matchValue, allow) {
|
|
2082
2102
|
const { op, value } = criteria;
|
|
2083
2103
|
if (allow && !allow.has(op)) {
|
|
2084
2104
|
return null;
|
|
2085
2105
|
}
|
|
2106
|
+
if (op in numericOperatorEvaluators) {
|
|
2107
|
+
return evaluateNumericOperator(criteria, matchValue);
|
|
2108
|
+
}
|
|
2086
2109
|
let opMatch = op;
|
|
2087
2110
|
const negation = op.startsWith("!");
|
|
2088
2111
|
if (negation) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/next-app-router",
|
|
3
|
-
"version": "20.49.
|
|
3
|
+
"version": "20.49.3",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
@@ -99,12 +99,12 @@
|
|
|
99
99
|
"vitest": "3.2.4"
|
|
100
100
|
},
|
|
101
101
|
"dependencies": {
|
|
102
|
-
"@uniformdev/canvas-react": "20.49.
|
|
103
|
-
"@uniformdev/next-app-router-client": "20.49.
|
|
104
|
-
"@uniformdev/next-app-router-shared": "20.49.
|
|
105
|
-
"@uniformdev/redirect": "20.49.
|
|
106
|
-
"@uniformdev/richtext": "20.49.
|
|
107
|
-
"@uniformdev/webhooks": "20.49.
|
|
102
|
+
"@uniformdev/canvas-react": "20.49.3",
|
|
103
|
+
"@uniformdev/next-app-router-client": "20.49.3",
|
|
104
|
+
"@uniformdev/next-app-router-shared": "20.49.3",
|
|
105
|
+
"@uniformdev/redirect": "20.49.3",
|
|
106
|
+
"@uniformdev/richtext": "20.49.3",
|
|
107
|
+
"@uniformdev/webhooks": "20.49.3",
|
|
108
108
|
"@vercel/functions": "^2.2.2",
|
|
109
109
|
"encoding": "^0.1.13",
|
|
110
110
|
"server-only": "^0.0.1",
|
|
@@ -121,5 +121,5 @@
|
|
|
121
121
|
"publishConfig": {
|
|
122
122
|
"access": "public"
|
|
123
123
|
},
|
|
124
|
-
"gitHead": "
|
|
124
|
+
"gitHead": "a6424635c7b318f5039e4d9c4d5a2ec72125af46"
|
|
125
125
|
}
|