@hexclave/dashboard-ui-components 1.0.101 → 1.0.103
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.
|
@@ -8193,10 +8193,15 @@ attempted value: ${formattedValue}
|
|
|
8193
8193
|
var intervalOrNeverSchema = yupUnion(intervalSchema.defined(), yupString().oneOf(["never"]).defined());
|
|
8194
8194
|
var dayIntervalOrNeverSchema = yupUnion(dayIntervalSchema.defined(), yupString().oneOf(["never"]).defined());
|
|
8195
8195
|
var USER_SPECIFIED_ID_PATTERN = /^[a-zA-Z0-9_][a-zA-Z0-9_-]*$/;
|
|
8196
|
+
var RESERVED_USER_SPECIFIED_IDS = /* @__PURE__ */ new Set([
|
|
8197
|
+
"__proto__",
|
|
8198
|
+
"constructor",
|
|
8199
|
+
"prototype"
|
|
8200
|
+
]);
|
|
8196
8201
|
function getUserSpecifiedIdErrorMessage(idName) {
|
|
8197
|
-
return `${idName} must contain only letters, numbers, underscores, and hyphens, and not start with a hyphen`;
|
|
8202
|
+
return `${idName} must contain only letters, numbers, underscores, and hyphens, and not start with a hyphen, and must not be one of ${[...RESERVED_USER_SPECIFIED_IDS].join(", ")}`;
|
|
8198
8203
|
}
|
|
8199
|
-
var userSpecifiedIdSchema = (idName) => yupString().max(63).matches(USER_SPECIFIED_ID_PATTERN, getUserSpecifiedIdErrorMessage(idName));
|
|
8204
|
+
var userSpecifiedIdSchema = (idName) => yupString().max(63).matches(USER_SPECIFIED_ID_PATTERN, getUserSpecifiedIdErrorMessage(idName)).test("not-reserved", `${idName} must not be a reserved name (${[...RESERVED_USER_SPECIFIED_IDS].join(", ")})`, (value) => value == null || !RESERVED_USER_SPECIFIED_IDS.has(value));
|
|
8200
8205
|
var moneyAmountSchema = (currency) => yupString().test("money-amount", "Invalid money amount", (value, context) => {
|
|
8201
8206
|
if (value == null) return true;
|
|
8202
8207
|
const match2 = value.match(/^([0-9]+)(\.([0-9]+))?$/);
|