Skip to content

Commit 57f6250

Browse files
Update src/functions/projectConfig.ts
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 78949b3 commit 57f6250

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/functions/projectConfig.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ export function validatePrefix(prefix: string): void {
4444
if (prefix.length > 30) {
4545
throw new FirebaseError("Invalid prefix. Prefix must be 30 characters or less.");
4646
}
47-
if (!/^[a-z0-9-]+$/.test(prefix)) {
48-
throw new FirebaseError(
49-
"Invalid prefix. Prefix can contain only lowercase letters, numeric characters, and dashes.",
50-
);
51-
}
47+
if (!/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(prefix)) {
48+
throw new FirebaseError(
49+
"Invalid prefix. Prefix can contain only lowercase letters, numeric characters, and dashes, and cannot start or end with a dash.",
50+
);
51+
}
5252
}
5353

5454
function validateSingle(config: FunctionConfig): ValidatedSingle {

0 commit comments

Comments
 (0)