mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-24 02:51:17 -08:00
5 lines
267 B
TypeScript
5 lines
267 B
TypeScript
export const matchMxId = (id: string): RegExpMatchArray | null =>
|
|
id.match(/^([@$+#])([^\s:]*):(\S+)$/);
|
|
export const validMxId = (id: string): boolean => !!matchMxId(id);
|
|
export const getMxIdServer = (userId: string): string | undefined => matchMxId(userId)?.[3];
|