mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-20 23:55:04 +00:00
Initial implementation of adding blank projects
This commit is contained in:
11
src/app/components/projects/models/validator.ts
Normal file
11
src/app/components/projects/models/validator.ts
Normal file
@ -0,0 +1,11 @@
|
||||
export class Validator {
|
||||
static projectNameValidator(projectName) {
|
||||
var pattern = new RegExp(/[~`!#$%\^&*+=\[\]\\';,/{}|\\":<>\?]/);
|
||||
|
||||
if(!pattern.test(projectName.value)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return { invalidName: true }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user