Files
Sable/src/app/utils/mxIdHelper.ts
T
2026-07-11 18:21:10 -05:00

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];