move name validation to a non type specific validator

This commit is contained in:
Sebastian Sdorra
2018-08-08 13:45:27 +02:00
parent 3ff6129b09
commit 378a82244d
6 changed files with 64 additions and 73 deletions

View File

@@ -1,10 +1,8 @@
// @flow
const nameRegex = /^([A-z0-9.\-_@]|[^ ]([A-z0-9.\-_@ ]*[A-z0-9.\-_@]|[^\s])?)$/;
import { isNameValid } from "../../components/validation";
export const isNameValid = (name: string) => {
return nameRegex.test(name);
};
export { isNameValid };
export const isDisplayNameValid = (displayName: string) => {
if (displayName) {