1
0
Fork 0

fix(new-design): Names cannot start with a digit

This commit is contained in:
Benjamin Fan 2023-05-26 21:20:12 -07:00
parent f280da1eaf
commit 55d659f8ce
2 changed files with 4 additions and 4 deletions

View file

@ -49,9 +49,9 @@ export const checkNodeVersion = () => {
// Helper method to validate the design name
const validateDesignName = (name) => {
if (/^([a-z0-9][a-z0-9_\-]*)$/.test(name)) return true
if (/^([a-z][a-z0-9_\-]*)$/.test(name)) return true
else
return ' 🙈 Please use only lowercase letters, digits, underscores, or hyphens. Names must start with a lowercase letter or digit. 🤷'
return ' 🙈 Please use only lowercase letters, digits, underscores, or hyphens. Names must start with a lowercase letter. 🤷'
}
// Gets user input to figure out what to do

View file

@ -223,9 +223,9 @@ function validateDesignName(name) {
)
return `Sorry but ${name} is already taken so you'll need to pick something else`
if (/^([a-z0-9][a-z0-9_\-]*)$/.test(name)) return true
if (/^([a-z][a-z0-9_\-]*)$/.test(name)) return true
else
return ' 🙈 Please use only lowercase letters, digits, underscores, or hyphens. Names must start with a lowercase letter or digit. 🤷'
return ' 🙈 Please use only lowercase letters, digits, underscores, or hyphens. Names must start with a lowercase letter. 🤷'
}
function validatePluginName(name) {