38 lines
1.3 KiB
TypeScript
38 lines
1.3 KiB
TypeScript
// Module ID: 4717
|
|
// Function ID: 4718
|
|
// Name: RouteUtils
|
|
// Dependencies: [1086, 2058, 2, 4718]
|
|
// Exports: isPseudoGuildId, isValidChannelId, isValidGuildId
|
|
|
|
// Module 4717 (RouteUtils)
|
|
import RouteConstants from "RouteConstants" /* 1086 */;
|
|
import ChannelConstants from "ChannelConstants" /* 2058 */;
|
|
import RouteParam from "RouteParam" /* 4718 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
const PSEUDO_GUILD_IDS = RouteConstants.PSEUDO_GUILD_IDS;
|
|
const isStaticChannelRoute = ChannelConstants.isStaticChannelRoute;
|
|
const re2 = /^\d+$/;
|
|
const result = size.fileFinishedImporting("modules/routing/RouteUtils.tsx");
|
|
const RouteParam_export = RouteParam.RouteParam;
|
|
|
|
export { RouteParam_export as RouteParam };
|
|
export const isPseudoGuildId = function isPseudoGuildId(guildId) {
|
|
return PSEUDO_GUILD_IDS.includes(guildId);
|
|
};
|
|
export const isValidGuildId = function isValidGuildId(guildId) {
|
|
let tmp = null != guildId;
|
|
if (tmp) {
|
|
const hasItem = PSEUDO_GUILD_IDS.includes(guildId) || re2.test(guildId);
|
|
tmp = hasItem;
|
|
}
|
|
return tmp;
|
|
};
|
|
export const isValidChannelId = function isValidChannelId(channelId) {
|
|
let tmp = null == channelId;
|
|
if (!tmp) {
|
|
const isMatch = re2.test(channelId) || isStaticChannelRoute(channelId);
|
|
tmp = isMatch;
|
|
}
|
|
return tmp;
|
|
};
|