Skip to content

Commit

Permalink
reverse refactor of normalizedInputName to allow digit
Browse files Browse the repository at this point in the history
  • Loading branch information
eternalmaha committed Sep 15, 2024
1 parent 654a733 commit f823aeb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/utils/validateTrimmedString.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ export function validateItemName(
}

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

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

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

0 comments on commit f823aeb

Please sign in to comment.