Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 69150a6

Browse files
Validation for analytics event key seems incorrect #1378
1 parent 3943bb9 commit 69150a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/analytics/analytics-common.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function validateAnalyticsKey(key: string): string | undefined {
99
return "Argument 'key' must be 40 characters or fewer";
1010
}
1111

12-
if (!key.match(/^[a-zA-Z][a-zA-Z_]+$/)) {
12+
if (!key.match(/^[a-zA-Z0-9][a-zA-Z0-9_]+$/)) {
1313
return "Argument 'key' can only contain alphanumeric characters and underscores and must start with an alphanumeric character";
1414
}
1515

@@ -67,7 +67,7 @@ function validateAnalyticsParamKey(key: string): string | undefined {
6767
return "Param 'key' must be 40 characters or fewer";
6868
}
6969

70-
if (!key.match(/^[a-zA-Z][a-zA-Z_]+$/)) {
70+
if (!key.match(/^[a-zA-Z0-9][a-zA-Z0-9_]+$/)) {
7171
return "Param 'key' can only contain alphanumeric characters and underscores and must start with an alphanumeric character";
7272
}
7373

0 commit comments

Comments
 (0)