MCPcopy Create free account
hub / github.com/firebase/firebase-tools / validateProjectId

Function validateProjectId

src/command.ts:504–519  ·  view source on GitHub ↗
(project: string)

Source from the content-addressed store, hash-verified

502 * @throws {FirebaseError} if project id has invalid format.
503 */
504export function validateProjectId(project: string): void {
505 if (PROJECT_ID_REGEX.test(project)) {
506 return;
507 }
508 trackGA4("error", {
509 error_type: "Error (User)",
510 details: "Invalid project ID",
511 });
512 const invalidMessage = "Invalid project id: " + clc.bold(project) + ".";
513 if (project.toLowerCase() !== project) {
514 // Attempt to be more helpful in case uppercase letters are used.
515 throw new FirebaseError(invalidMessage + "\nNote: Project id must be all lowercase.");
516 } else {
517 throw new FirebaseError(invalidMessage);
518 }
519}

Callers 3

command.spec.tsFile · 0.90
setNewActiveFunction · 0.90
prepareMethod · 0.85

Calls 1

trackGA4Function · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…