Rewrite the restricted iterators and reorder the forward references. [skip build]
This commit is contained in:
@@ -10,7 +10,8 @@ function introDurationFromEffectMeta(
|
||||
}
|
||||
|
||||
function catalogAssetUrl(item: DiscordCollectibleItem, ...roles: string[]): string | undefined {
|
||||
for (const role of roles) {
|
||||
for (let i = 0; i < roles.length; i += 1) {
|
||||
const role = roles[i];
|
||||
const asset = item.assets.find((entry) => entry.role === role);
|
||||
if (asset?.url) return asset.url;
|
||||
}
|
||||
|
||||
@@ -192,7 +192,8 @@ export async function uploadCollectibleToMatrix(
|
||||
const urlToMxc = new Map<string, string>();
|
||||
const assets: Record<string, string> = {};
|
||||
|
||||
for (const asset of downloaded) {
|
||||
for (let i = 0; i < downloaded.length; i += 1) {
|
||||
const asset = downloaded[i];
|
||||
onProgress?.(`Uploading ${asset.filename}…`);
|
||||
const blob = new Blob([asset.data], { type: asset.mimeType });
|
||||
const file = new File([blob], asset.filename, { type: asset.mimeType });
|
||||
|
||||
@@ -143,7 +143,8 @@ export function convertEmoticonsInHtml(html: string): string {
|
||||
export function containsEmoticons(text: string): boolean {
|
||||
const emoticons = Object.keys(EMOTICON_MAP);
|
||||
|
||||
for (const emoticon of emoticons) {
|
||||
for (let i = 0; i < emoticons.length; i += 1) {
|
||||
const emoticon = emoticons[i];
|
||||
const escapedEmoticon = emoticon.replace(/[.*+?^${}()|[\]\\<>]/g, '\\$&');
|
||||
const regex = new RegExp(`(^|\\s)(${escapedEmoticon})(?=\\s|$)`);
|
||||
|
||||
|
||||
@@ -209,7 +209,8 @@ export const findForumRootSpace = (
|
||||
roomToParents: RoomToParents,
|
||||
): string | undefined => {
|
||||
const ordered = [roomId, ...Array.from(getAllParents(roomToParents, roomId))];
|
||||
for (const id of ordered) {
|
||||
for (let i = 0; i < ordered.length; i += 1) {
|
||||
const id = ordered[i];
|
||||
const room = mx.getRoom(id);
|
||||
if (room && shouldShowForumLobby(room)) return id;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user