@constela/core 0.17.2 → 0.17.4
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/index.js +19 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -988,9 +988,9 @@ function isObject3(value) {
|
|
|
988
988
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
989
989
|
}
|
|
990
990
|
var VALID_VIEW_KINDS = ["element", "text", "if", "each", "component", "slot", "markdown", "code", "portal", "island"];
|
|
991
|
-
var VALID_EXPR_TYPES = ["lit", "state", "var", "bin", "not", "param", "cond", "get", "style", "validity", "index", "call", "lambda", "array"];
|
|
991
|
+
var VALID_EXPR_TYPES = ["lit", "state", "var", "bin", "not", "param", "cond", "get", "style", "validity", "index", "call", "lambda", "array", "concat"];
|
|
992
992
|
var VALID_PARAM_TYPES = ["string", "number", "boolean", "json"];
|
|
993
|
-
var VALID_ACTION_TYPES = ["set", "update", "setPath", "fetch", "delay", "interval", "clearTimer", "focus", "if", "storage", "dom"];
|
|
993
|
+
var VALID_ACTION_TYPES = ["set", "update", "setPath", "fetch", "delay", "interval", "clearTimer", "focus", "if", "storage", "dom", "sseConnect", "sseClose", "optimistic", "confirm", "reject"];
|
|
994
994
|
var VALID_STATE_TYPES = ["number", "string", "list", "boolean", "object"];
|
|
995
995
|
var VALID_BIN_OPS = BINARY_OPERATORS;
|
|
996
996
|
var VALID_UPDATE_OPS = UPDATE_OPERATIONS;
|
|
@@ -1073,8 +1073,11 @@ function validateViewNode(node, path) {
|
|
|
1073
1073
|
}
|
|
1074
1074
|
if (node["props"] !== void 0 && isObject3(node["props"])) {
|
|
1075
1075
|
for (const [propName, propValue] of Object.entries(node["props"])) {
|
|
1076
|
-
|
|
1077
|
-
|
|
1076
|
+
if (isObject3(propValue) && "event" in propValue) {
|
|
1077
|
+
} else {
|
|
1078
|
+
const error = validateExpression(propValue, path + "/props/" + propName);
|
|
1079
|
+
if (error) return error;
|
|
1080
|
+
}
|
|
1078
1081
|
}
|
|
1079
1082
|
}
|
|
1080
1083
|
if (Array.isArray(node["children"])) {
|
|
@@ -1360,6 +1363,18 @@ function validateExpression(expr, path) {
|
|
|
1360
1363
|
if (elemError) return elemError;
|
|
1361
1364
|
}
|
|
1362
1365
|
break;
|
|
1366
|
+
case "concat":
|
|
1367
|
+
if (!("items" in expr)) {
|
|
1368
|
+
return { path: path + "/items", message: "items is required" };
|
|
1369
|
+
}
|
|
1370
|
+
if (!Array.isArray(expr["items"])) {
|
|
1371
|
+
return { path: path + "/items", message: "items must be an array" };
|
|
1372
|
+
}
|
|
1373
|
+
for (let i = 0; i < expr["items"].length; i++) {
|
|
1374
|
+
const itemError = validateExpression(expr["items"][i], path + "/items/" + i);
|
|
1375
|
+
if (itemError) return itemError;
|
|
1376
|
+
}
|
|
1377
|
+
break;
|
|
1363
1378
|
}
|
|
1364
1379
|
return null;
|
|
1365
1380
|
}
|