This commit is contained in:
Zach Russell 2025-03-22 14:33:17 -06:00
parent 993bccc439
commit 845fc0e110
2 changed files with 2 additions and 2 deletions

View file

@ -80,7 +80,7 @@ function getFallbackCharacter(from: unknown, idx: number): string {
} }
// Array.from appears to be the only way to handle Unicode correctly // Array.from appears to be the only way to handle Unicode correctly
return Array.from(from.slice(0, (idx + 1) * 2))[idx]?.toUpperCase().toWellFormed() ?? ""; return Array.from(from.slice(0, (idx + 1) * 2))[idx]?.toUpperCase().toWellFormed() ?? ""
} }
export const getAvatarURL = ( export const getAvatarURL = (

View file

@ -17,7 +17,7 @@ import { ContentURI, EventID, RoomAlias, RoomID, UserID, UserProfile } from "@/a
const simpleHomeserverRegex = /^[a-zA-Z0-9.:-]+$/ const simpleHomeserverRegex = /^[a-zA-Z0-9.:-]+$/
const mediaRegex = /^mxc:\/\/([a-zA-Z0-9.:-]+)\/([a-zA-Z0-9_-]+)$/ const mediaRegex = /^mxc:\/\/([a-zA-Z0-9.:-]+)\/([a-zA-Z0-9_-]+)$/
const phoneNumberRegex = /^(?:(?:\+\d{1,4}[-.\s]?)?(?:\(?\d{1,4}\)?[-.\s]?\d{1,4}[-.\s]?\d{1,4}|\d{5,10})|\d{4,6})$/; const phoneNumberRegex = /^(?:(?:\+\d{1,4}[-.\s]?)?(?:\(?\d{1,4}\)?[-.\s]?\d{1,4}[-.\s]?\d{1,4}|\d{5,10})|\d{4,6})$/
function isIdentifier<T>(identifier: unknown, sigil: string, requiresServer: boolean): identifier is T { function isIdentifier<T>(identifier: unknown, sigil: string, requiresServer: boolean): identifier is T {
if (typeof identifier !== "string" || !identifier.startsWith(sigil)) { if (typeof identifier !== "string" || !identifier.startsWith(sigil)) {