[Major] Removed unnecessary project name restriction (#859)

* removed unnecessary restriction that prevented project names from starting with a number. Project names starting with a number is perfectly valid.

* Reworded validateProjectName jsdoc

Co-Authored-By: Raphael von der Grün <raphinesse@gmail.com>

Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
This commit is contained in:
Norman Breau
2020-01-07 10:10:04 -04:00
committed by GitHub
parent 0e6ad28e56
commit 91d2716122
2 changed files with 5 additions and 28 deletions
+1 -11
View File
@@ -208,7 +208,7 @@ function validatePackageName (package_name) {
}
/**
* Test whether a project name is acceptable for use as an android class.
* Test whether given string is acceptable for use as a project name
* Returns a promise, fulfilled if the project name is acceptable; rejected
* otherwise.
*/
@@ -219,16 +219,6 @@ function validateProjectName (project_name) {
return Promise.reject(new CordovaError(msg + 'Project name cannot be empty'));
}
// Enforce stupid name error
if (project_name === 'CordovaActivity') {
return Promise.reject(new CordovaError(msg + 'Project name cannot be CordovaActivity'));
}
// Classes in Java don't begin with numbers
if (/^[0-9]/.test(project_name)) {
return Promise.reject(new CordovaError(msg + 'Project name must not begin with a number'));
}
return Promise.resolve();
}