decord/alpha/source/modules/routing/RouteParam.tsx

77 lines
2.2 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 4919
// Function ID: 4920
2026-07-29 08:29:29 +00:00
// Name: RouteParam
2026-10-09 10:00:15 +00:00
// Dependencies: [1086, 2071, 1094, 4920, 2]
2026-07-20 16:05:17 +00:00
2026-10-09 10:00:15 +00:00
// Module 4919 (RouteParam)
2026-10-03 08:58:59 +00:00
import RouteConstants from "RouteConstants" /* 1086 */;
import utils_PathUtils from "utils/PathUtils" /* 1094 */;
2026-10-09 10:00:15 +00:00
import ChannelConstants from "ChannelConstants" /* 2071 */;
import escapeRegExpDefault from "escapeRegExp" /* 4920 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const PSEUDO_GUILD_IDS = RouteConstants.PSEUDO_GUILD_IDS;
const StaticChannelRoutes = ChannelConstants.StaticChannelRoutes;
2026-10-03 08:58:59 +00:00
let obj = {
2026-07-29 08:29:29 +00:00
guildId() {
let obj = arg0;
if (arg0 === undefined) {
2026-07-20 16:05:17 +00:00
obj = {};
}
let str = obj.name;
if (str === undefined) {
str = "guildId";
}
let flag = obj.optional;
if (flag === undefined) {
flag = false;
}
2026-08-24 06:08:38 +00:00
const mapped = PSEUDO_GUILD_IDS.map(escapeRegExpDefault);
2026-07-29 08:29:29 +00:00
const combined = "" + mapped.join("|") + "|\\d+";
let flag2 = { optional: flag }.optional;
if (flag2 === undefined) {
flag2 = false;
}
2026-10-03 08:58:59 +00:00
const UnescapedPathParam = utils_PathUtils.UnescapedPathParam;
2026-07-29 08:29:29 +00:00
let str2 = "";
2026-10-03 08:58:59 +00:00
const tmp4 = escapeRegExpDefault(str);
2026-07-29 08:29:29 +00:00
if (flag2) {
str2 = "?";
}
2026-10-03 08:58:59 +00:00
const unescapedPathParam = new UnescapedPathParam(":" + tmp4 + "(" + combined + ")" + str2);
2026-07-29 08:29:29 +00:00
return unescapedPathParam;
2026-07-20 16:05:17 +00:00
},
2026-07-29 08:29:29 +00:00
channelId() {
let obj = arg0;
if (arg0 === undefined) {
2026-07-20 16:05:17 +00:00
obj = {};
}
let str = obj.name;
if (str === undefined) {
str = "channelId";
}
let flag = obj.optional;
if (flag === undefined) {
flag = false;
}
2026-07-23 10:11:24 +00:00
const items = [...StaticChannelRoutes];
2026-08-24 06:08:38 +00:00
const mapped = items.map(escapeRegExpDefault);
2026-07-29 08:29:29 +00:00
const combined = "" + mapped.join("|") + "|\\d+";
let flag2 = { optional: flag }.optional;
if (flag2 === undefined) {
flag2 = false;
}
2026-10-03 08:58:59 +00:00
const UnescapedPathParam = utils_PathUtils.UnescapedPathParam;
2026-07-29 08:29:29 +00:00
let str2 = "";
2026-10-03 08:58:59 +00:00
const tmp4 = escapeRegExpDefault(str);
2026-07-29 08:29:29 +00:00
if (flag2) {
str2 = "?";
}
2026-10-03 08:58:59 +00:00
const unescapedPathParam = new UnescapedPathParam(":" + tmp4 + "(" + combined + ")" + str2);
2026-07-29 08:29:29 +00:00
return unescapedPathParam;
2026-07-20 16:05:17 +00:00
}
};
2026-10-03 08:58:59 +00:00
const result = size.fileFinishedImporting("modules/routing/RouteParam.tsx");
export const RouteParam = obj;