Skip to content

Commit

Permalink
Fixed name format
Browse files Browse the repository at this point in the history
  • Loading branch information
alantao912 committed Nov 19, 2023
1 parent 6edc20b commit 73c1fac
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion frontend/src/common/utils/nameFormat.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
export const isNameValid = (name: string) : boolean => {
return /[^a-zA-Z]/.test(name)
name = name.toLowerCase();
for (let i = 0; i < name.length; ++i) {
const c = name.charAt(i);
if (c.toLowerCase() === c.toUpperCase()) {
return false;
}
}
return true;
}

0 comments on commit 73c1fac

Please sign in to comment.