Skip to content

Commit

Permalink
Updated from pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
AccelByte-Build committed Nov 4, 2024
1 parent 1e6b6b9 commit f9eafdd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/weak-houses-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@accelbyte/validator': patch
---

fix: CW-4708 handle maxRepeatingSpecialCharacter rule when specialChars empty
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ export const validateDisplayName = (
}
}

if (allowAllSpecialCharacters) {
specialCharacters = [...specialCharacters, '_\\W']
}

if (!allowAllSpecialCharacters && specialCharacters?.length === 0) {
const regex = allowUnicode ? REGEX_SPECIAL_CHARACTERS_AND_UNICODE : REGEX_ALL_SPECIAL_CHARACTERS
if (regex.test(value)) return ValidateDisplayNameErrorType.enum.invalidFormat
Expand Down

0 comments on commit f9eafdd

Please sign in to comment.