Validate and deduplicate custom difficulty presets
Some checks failed
Deploy MineGeo to Dokploy / deploy (push) Failing after 6m4s

This commit is contained in:
2026-10-16 13:29:32 +05:00
parent 1a34eb71c2
commit 0bd05d6e0b
10 changed files with 427 additions and 41 deletions

View File

@@ -194,8 +194,10 @@ export const customDifficultySchema = z
name: z
.string()
.trim()
.min(2)
.max(40)
.refine(
(name) => [...name].length >= 2 && [...name].length <= 40,
"Difficulty names must contain 2–40 characters",
)
.refine(
(name) =>
!/[\u0000-\u001f\u007f-\u009f\u202a-\u202e\u2066-\u2069]/u.test(