fix(new-design): Names cannot start with a digit
This commit is contained in:
parent
f280da1eaf
commit
55d659f8ce
2 changed files with 4 additions and 4 deletions
|
@ -49,9 +49,9 @@ export const checkNodeVersion = () => {
|
||||||
|
|
||||||
// Helper method to validate the design name
|
// Helper method to validate the design name
|
||||||
const validateDesignName = (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
|
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
|
// Gets user input to figure out what to do
|
||||||
|
|
|
@ -223,9 +223,9 @@ function validateDesignName(name) {
|
||||||
)
|
)
|
||||||
return `Sorry but ${name} is already taken so you'll need to pick something else`
|
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
|
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) {
|
function validatePluginName(name) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue