align validation of repository name and namespace

This commit is contained in:
Sebastian Sdorra
2019-03-12 15:10:05 +01:00
parent c180457214
commit f7f5102541
5 changed files with 93 additions and 14 deletions

View File

@@ -1,8 +1,10 @@
// @flow
import { validation } from "@scm-manager/ui-components";
const nameRegex = /(?!^\.\.$)(?!^\.$)(?!.*[\\\[\]])^[A-z0-9\.][A-z0-9\.\-_]*$/;
export const isNameValid = (name: string) => {
return validation.isNameValid(name);
return nameRegex.test(name);
};
export function isContactValid(mail: string) {