decord/source/modules/connections/FederatedSocialUtils.tsx
github-actions 777dc50a28 chore: update source for alpha 346.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
2026-09-10 19:12:31 +00:00

31 lines
1 KiB
TypeScript

// Module ID: 9353
// Function ID: 9354
// Name: FederatedSocialUtils
// Dependencies: [1074, 2]
// Exports: getExampleHandle, validateHandle
// Module 9353 (FederatedSocialUtils)
import Constants from "Constants" /* 1074 */;
import size from "module_2" /* 2 */;
const PlatformTypes = Constants.PlatformTypes;
const result = size.fileFinishedImporting("modules/connections/FederatedSocialUtils.tsx");
export const validateHandle = function validateHandle(arg0, platformType) {
if (platformType === PlatformTypes.MASTODON) {
const isMatch = /^@?[a-z0-9_]+([.-]+[a-z0-9_]+)*@[^@]+\.[^.@]{2,}$/i.test(arg0);
const obj = /^@?[a-z0-9_]+([.-]+[a-z0-9_]+)*@[^@]+\.[^.@]{2,}$/i;
}
return /^.+\.[^.@]{2,}$/.test(arg0);
};
export const getExampleHandle = function getExampleHandle(platformType) {
let str = "@example@mastodon.social";
if (platformType !== PlatformTypes.MASTODON) {
let str2 = "clyde@example.com";
if (platformType === PlatformTypes.BLUESKY) {
str2 = "example.bsky.social";
}
str = str2;
}
return str;
};