Skip to content

Commit f823aeb

Browse files
committed
reverse refactor of normalizedInputName to allow digit
1 parent 654a733 commit f823aeb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/utils/validateTrimmedString.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ export function validateItemName(
1313
}
1414

1515
//Remove punctuation marks and normalize input
16-
const punctuationRegex = /[^a-z0-9]/g;
16+
const punctuationRegex = /[^\p{L}]/gu;
1717

18-
const normalizedInputName = input.toLowerCase().replace(/[^a-z0-9]/g, "");
18+
const normalizedInputName = trimmedInput
19+
.replace(punctuationRegex, "")
20+
.toLowerCase();
1921

2022
//Create a list of normalized existing item names
2123
const normalizedExistingItemNames = existingItems.map((existingItem) => {

0 commit comments

Comments
 (0)