mirror of
https://gitea.tendokyu.moe/ppc/amnet.git
synced 2026-10-07 14:18:17 +03:00
move regex to const
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
export const CARD_ID_REGEX = /^(?:[0-9]{4} ?){5}$/i;
|
||||
|
||||
/**
|
||||
* Generates a random Aime card id.
|
||||
*/
|
||||
@@ -16,5 +18,5 @@ export function generateAimeCardId(): string {
|
||||
* @param id The card id to validate
|
||||
*/
|
||||
export function validateAimeCardId(id: string): boolean {
|
||||
return id[0] !== '3' && /^[0-9A-F]{20}$/i.test(id);
|
||||
return id[0] !== '3' && CARD_ID_REGEX.test(id);
|
||||
}
|
||||
Reference in New Issue
Block a user