Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4825.js (118.4 MB)
63 lines
2.8 KiB
TypeScript
63 lines
2.8 KiB
TypeScript
// Module ID: 7775
|
|
// Function ID: 7776
|
|
// Name: UserSearchUtils
|
|
// Dependencies: [7776, 2022, 4288, 1074, 1926, 4484, 2]
|
|
// Exports: cleanString, getNames, getRelationshipType
|
|
|
|
// Module 7775 (UserSearchUtils)
|
|
import StringUtils from "StringUtils" /* 1926 */;
|
|
import UserUtilsDefault from "UserUtils" /* 4484 */;
|
|
import FriendSuggestionStore from "FriendSuggestionStore" /* 7776 */;
|
|
import GuildMemberStore from "GuildMemberStore" /* 2022 */;
|
|
import RelationshipStore from "RelationshipStore" /* 4288 */;
|
|
|
|
require = fn;
|
|
const RelationshipTypes = fn(1074).RelationshipTypes;
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/main_tabs_v2/UserSearchUtils.tsx");
|
|
|
|
export const cleanString = function cleanString(toLocaleLowerCase) {
|
|
return StringUtils.stripDiacritics(toLocaleLowerCase.toLocaleLowerCase()).trim();
|
|
};
|
|
export const getRelationshipType = function getRelationshipType(id) {
|
|
const relationshipType = RelationshipStore.getRelationshipType(id);
|
|
let SUGGESTION = relationshipType;
|
|
if (relationshipType === RelationshipTypes.NONE) {
|
|
SUGGESTION = relationshipType;
|
|
if (null != FriendSuggestionStore.getSuggestion(id)) {
|
|
SUGGESTION = tmp2.SUGGESTION;
|
|
}
|
|
}
|
|
return SUGGESTION;
|
|
};
|
|
export const getNames = function getNames(user) {
|
|
const names = {};
|
|
const nick = RelationshipStore.getNickname(user.id);
|
|
if (null != nick) {
|
|
const obj3 = names(1926);
|
|
let str = names(1926).stripDiacritics(nick.toLocaleLowerCase());
|
|
names[nick] = names(1926).stripDiacritics(nick.toLocaleLowerCase()).trim().split(" ");
|
|
let str2 = names(1926).stripDiacritics(nick.toLocaleLowerCase()).trim();
|
|
}
|
|
const globalName = UserUtilsDefault.getGlobalName(user);
|
|
if (tmp4) {
|
|
const obj6 = names(1926);
|
|
const str4 = names(1926).stripDiacritics(globalName.toLocaleLowerCase());
|
|
names[globalName] = names(1926).stripDiacritics(globalName.toLocaleLowerCase()).trim().split(" ");
|
|
const str5 = names(1926).stripDiacritics(globalName.toLocaleLowerCase()).trim();
|
|
}
|
|
const username = user.username;
|
|
tmp4 = null != globalName && null == names[globalName];
|
|
const obj7 = names(1926);
|
|
const str7 = names(1926).stripDiacritics(username.toLocaleLowerCase());
|
|
names[user.username] = names(1926).stripDiacritics(username.toLocaleLowerCase()).trim().split(" ");
|
|
const nicknames = GuildMemberStore.getNicknames(user.id);
|
|
const item = nicknames.forEach((toLocaleLowerCase) => {
|
|
if (null == names[toLocaleLowerCase]) {
|
|
const str = StringUtils.stripDiacritics(toLocaleLowerCase.toLocaleLowerCase());
|
|
tmp[toLocaleLowerCase] = StringUtils.stripDiacritics(toLocaleLowerCase.toLocaleLowerCase()).trim().split(" ");
|
|
const str2 = StringUtils.stripDiacritics(toLocaleLowerCase.toLocaleLowerCase()).trim();
|
|
}
|
|
});
|
|
return { names, nick };
|
|
};
|