fix(custom-widgets): finish v2 hardening

This commit is contained in:
Thomas Camlong committed 2026-07-20 23:39:57 +02:00
1 parent 7c66c912e7
commit 1c02678a7e
97 files changed
+2833 -12393

No files matched your search

@@ -118,13 +118,19 @@ function analyzeAttributeValue(
}
if (
attributeName === "maxDepth" &&
(typeof literalValue.value !== "number" || literalValue.value < 1 || literalValue.value > 32)
(typeof literalValue.value !== "number" ||
!Number.isInteger(literalValue.value) ||
literalValue.value < 1 ||
literalValue.value > 32)
) {
context.add(attribute, "INVALID_PROP_VALUE: 'maxDepth' must be between 1 and 32");
}
if (
attributeName === "maxNodes" &&
(typeof literalValue.value !== "number" || literalValue.value < 1 || literalValue.value > 2_000)
(typeof literalValue.value !== "number" ||
!Number.isInteger(literalValue.value) ||
literalValue.value < 1 ||
literalValue.value > 2_000)
) {
context.add(attribute, "INVALID_PROP_VALUE: 'maxNodes' must be between 1 and 2000");
}