3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

fix: shorter than 6 character invite codes

Fixes ZDEV-108
This commit is contained in:
Dragory 2024-01-27 15:05:35 +02:00
parent 008ac1bec0
commit 2ce5082018
No known key found for this signature in database

View file

@ -557,11 +557,12 @@ export function getUrlsInString(str: string, onlyUnique = false): MatchedURL[] {
}
export function parseInviteCodeInput(str: string): string {
if (str.match(/^[a-z0-9]{6,}$/i)) {
return str;
const parsedInviteCodes = getInviteCodesInString(str);
if (parsedInviteCodes.length) {
return parsedInviteCodes[0];
}
return getInviteCodesInString(str)[0];
return str;
}
export function isNotNull<T>(value: T): value is Exclude<T, null | undefined> {