2026-09-10 19:12:31 +00:00
|
|
|
// Module ID: 9353
|
|
|
|
|
// Function ID: 9354
|
2026-09-10 05:38:07 +00:00
|
|
|
// Name: FederatedSocialUtils
|
2026-09-05 10:56:28 +00:00
|
|
|
// Dependencies: [1074, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: getExampleHandle, validateHandle
|
|
|
|
|
|
2026-09-10 19:12:31 +00:00
|
|
|
// Module 9353 (FederatedSocialUtils)
|
2026-09-10 05:38:07 +00:00
|
|
|
import Constants from "Constants" /* 1074 */;
|
|
|
|
|
import size from "module_2" /* 2 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
const PlatformTypes = Constants.PlatformTypes;
|
|
|
|
|
const result = size.fileFinishedImporting("modules/connections/FederatedSocialUtils.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
export const validateHandle = function validateHandle(arg0, platformType) {
|
2026-07-20 16:05:17 +00:00
|
|
|
if (platformType === PlatformTypes.MASTODON) {
|
2026-09-10 05:38:07 +00:00
|
|
|
const isMatch = /^@?[a-z0-9_]+([.-]+[a-z0-9_]+)*@[^@]+\.[^.@]{2,}$/i.test(arg0);
|
2026-07-20 16:05:17 +00:00
|
|
|
const obj = /^@?[a-z0-9_]+([.-]+[a-z0-9_]+)*@[^@]+\.[^.@]{2,}$/i;
|
|
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
return /^.+\.[^.@]{2,}$/.test(arg0);
|
2026-07-20 16:05:17 +00:00
|
|
|
};
|
|
|
|
|
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;
|
|
|
|
|
};
|