Skip to content

Commit cc53979

Browse files
committed
feat: export forbidden username regex
1 parent 73ff70a commit cc53979

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/utilities/src/utilities.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,14 +321,14 @@ const FORBIDDEN_USERNAMES_REGEXPS = [
321321
];
322322

323323
// Regex matching forbidden usernames.
324-
const FORBIDDEN_REGEXP = new RegExp(`^(${ANONYMOUS_USERNAME}|${FORBIDDEN_USERNAMES_REGEXPS.join('|')})$`, 'i');
324+
export const FORBIDDEN_USERNAME_REGEXP = new RegExp(`^(${ANONYMOUS_USERNAME}|${FORBIDDEN_USERNAMES_REGEXPS.join('|')})$`, 'i');
325325

326326
/**
327327
* Checks whether username is listed in FORBIDDEN_USERNAMES
328328
* or matches any root route path.
329329
*/
330330
export function isForbiddenUsername(username: string): boolean {
331-
return !!username.match(APIFY_ID_REGEX) || !!username.match(FORBIDDEN_REGEXP);
331+
return !!username.match(APIFY_ID_REGEX) || !!username.match(FORBIDDEN_USERNAME_REGEXP);
332332
}
333333

334334
/**

0 commit comments

Comments
 (0)