decord/beta/source/modules/rpc/helpers/internalDeepLinks.tsx
github-actions e7a050048e chore: update source for beta 347.7
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4943.js (118.4 MB)
2026-09-21 19:31:18 +00:00

63 lines
2.1 KiB
TypeScript

// Module ID: 14766
// Function ID: 14767
// Name: internalDeepLinks
// Dependencies: [32, 1370, 4449, 8653, 2]
// Exports: openInternalDeepLink, resolveInternalDeepLink
// Module 14766 (internalDeepLinks)
import URLUtilsDefault from "URLUtils" /* 1370 */;
import openURL from "openURL" /* 4449 */;
import _slicedToArray from "module_32" /* 32 */;
require = fn;
const set = new Set(["channels", "users", "events"]);
const set1 = new Set(["", "-"]);
const size = fn(2);
const result = size.fileFinishedImporting("modules/rpc/helpers/internalDeepLinks.tsx");
export const resolveInternalDeepLink = function resolveInternalDeepLink(url) {
const toURLSafeResult = URLUtilsDefault.toURLSafe(url);
if (null == toURLSafeResult) {
return null;
} else {
({ hostname: hostname2, protocol, host } = toURLSafeResult);
if (tmpResult.isDiscordProtocol(protocol)) {
({ hostname, pathname } = toURLSafeResult);
if (!set1.has(hostname)) {
if (!tmpResult4.isDiscordHostname(hostname)) {
const _HermesInternal = HermesInternal;
let combined = "/" + hostname + pathname;
}
tmpResult4 = tmp(1370);
}
let combined1 = pathname;
if (!pathname.startsWith("/")) {
const _HermesInternal2 = HermesInternal;
combined1 = "/" + pathname;
}
combined = combined1;
} else {
if (!tmpResult5.isDiscordHostname(hostname2)) {
if (!tmpResult6.isDiscordLocalhost(host, hostname2)) {
return null;
}
tmpResult6 = tmp(1370);
}
const tmp11 = _slicedToArray(toURLSafeResult.pathname.split("/"), 2)[1];
let combined2 = null;
if (null != tmp11) {
combined2 = null;
if (set.has(tmp11)) {
const _HermesInternal3 = HermesInternal;
combined2 = "https://discord.com" + str + toURLSafeResult.search + toURLSafeResult.hash;
}
}
return combined2;
}
tmpResult = tmp(1370);
}
};
export const openInternalDeepLink = function openInternalDeepLink(internalDeepLink) {
openURL.default(internalDeepLink);
return true;
};