Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4792.js (118.4 MB)
43 lines
1.3 KiB
TypeScript
43 lines
1.3 KiB
TypeScript
// Module ID: 4446
|
|
// Function ID: 4447
|
|
// Name: RouteUtils
|
|
// Dependencies: [1075, 1964, 2, 4447]
|
|
// Exports: isPseudoGuildId, isValidChannelId, isValidGuildId
|
|
|
|
// Module 4446 (RouteUtils)
|
|
import RouteConstants from "RouteConstants" /* 1075 */;
|
|
import ChannelConstants from "ChannelConstants" /* 1964 */;
|
|
import RouteParam from "RouteParam" /* 4447 */;
|
|
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");
|
|
|
|
export const RouteParam = RouteParam.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) {
|
|
let hasItem = PSEUDO_GUILD_IDS.includes(guildId);
|
|
if (!hasItem) {
|
|
hasItem = re2.test(guildId);
|
|
}
|
|
tmp = hasItem;
|
|
}
|
|
return tmp;
|
|
};
|
|
export const isValidChannelId = function isValidChannelId(channelId) {
|
|
let tmp = null == channelId;
|
|
if (!tmp) {
|
|
let isMatch = re2.test(channelId);
|
|
if (!isMatch) {
|
|
isMatch = isStaticChannelRoute(channelId);
|
|
}
|
|
tmp = isMatch;
|
|
}
|
|
return tmp;
|
|
};
|