@saiforceone/dirt-cli
Version:
Official CLI Utility for the D.I.R.T stack
19 lines (16 loc) • 496 B
text/typescript
/**
* @description Checks a given project name to determine if it is valid
* @param projectName
*/
// exclude starting with
const validPattern = /^[a-z]\w+$/gim;
/**
* @description Helper function to validate a project name. Valid project names should start with a letter and not
* contain spaces or dashes
* @param {string} projectName
* @returns {*}
*/
export function validateProjectName(projectName: string) {
if (!projectName) return;
return projectName.match(validPattern);
}