mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 00:15:44 +01:00
use reflow to migrate from flow to typescript
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { validation } from '@scm-manager/ui-components';
|
||||
|
||||
const nameRegex = /(?!^\.\.$)(?!^\.$)(?!.*[\\\[\]])^[A-Za-z0-9\.][A-Za-z0-9\.\-_]*$/;
|
||||
|
||||
export const isNameValid = (name: string) => {
|
||||
return nameRegex.test(name);
|
||||
};
|
||||
|
||||
export function isContactValid(mail: string) {
|
||||
return '' === mail || validation.isMailValid(mail);
|
||||
}
|
||||
Reference in New Issue
Block a user