Fix regex

This commit is contained in:
Kai Vogelgesang 2022-10-11 14:00:26 +02:00
parent ac757fd322
commit 822f97de4d
Signed by: kai
GPG Key ID: 0A95D3B6E62C0879

View File

@ -1,7 +1,7 @@
import { APIEndPoint, PartyStatus, SelfStatus } from "./PartyContext";
export const parseURI = (uri: string): APIEndPoint | undefined => {
const x = uri.match(/https?:\/\/(?<partyName>.+)\.(?<host>.+)\/(?<token>.+)/);
const x = uri.match(/https?:\/\/(?<partyName>\w+)\.(?<host>.+)\/(?<token>.+)/);
if (x === null || x.groups === undefined) return;
const partyName = x.groups["partyName"];
const token = x.groups["token"];