Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
31 lines
1 KiB
TypeScript
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;
|
|
};
|