Files
discord-decomp/modules/routing/RouteParam.tsx
T
2026-11-01 12:12:55 +02:00

31 lines
1.1 KiB
TypeScript

// Metro module 4025 (f4026).
import { PSEUDO_GUILD_IDS } from "./RouteConstants";
import { StaticChannelRoutes } from "../channel/ChannelConstants";
import { UnescapedPathParam } from "../../_bundle/getAuthenticationPath";
import escapeRegExp from "../../_bundle/escapeRegExp";
const r20 = {
guildId: function guildId(r2 = {}) {
const { name = "guildId", optional = false } = r2;
const r27 = `${PSEUDO_GUILD_IDS.map(escapeRegExp).join("|")}|\\d+`;
let optional2 = ({
optional
}).optional;
if (optional2 === void 0) {
optional2 = false;
}
return new UnescapedPathParam(`:${escapeRegExp(name)}(${r27})${optional2 ? "?" : ""}`);
},
channelId: function channelId(r3 = {}) {
const { name = "channelId", optional = false } = r3;
const r28 = `${[...StaticChannelRoutes].map(escapeRegExp).join("|")}|\\d+`;
let optional2 = ({
optional
}).optional;
if (optional2 === void 0) {
optional2 = false;
}
return new UnescapedPathParam(`:${escapeRegExp(name)}(${r28})${optional2 ? "?" : ""}`);
}
};
export { r20 as RouteParam };