Validate banch names

This commit is contained in:
René Pfeuffer
2020-10-29 13:09:17 +01:00
parent 5f21f1a97d
commit c2a7ed8869
8 changed files with 42 additions and 18 deletions

View File

@@ -28,6 +28,12 @@ export const isNameValid = (name: string) => {
return nameRegex.test(name);
};
export const branchRegex = /^[\w-,;\]{}@&+=$#`|<>]([\w-,;\]{}@&+=$#`|<>/.]*[\w-,;\]{}@&+=$#`|<>])?$/;
export const isBranchValid = (name: string) => {
return branchRegex.test(name);
};
const mailRegex = /^[ -~]+@[A-Za-z0-9][\w\-.]*\.[A-Za-z0-9][A-Za-z0-9-]+$/;
export const isMailValid = (mail: string) => {