Skip to content

Commit 7a0f8e0

Browse files
committed
Changed for.each loops to for loops
1 parent 4995727 commit 7a0f8e0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/settings/Settings.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -331,22 +331,22 @@ export class MediaDbSettingTab extends PluginSettingTab {
331331
const mediaTypeApiMap = new Map<string, string[]>();
332332

333333
// Populate the map with APIs for each media type
334-
Object.entries(this.plugin.settings.apiToggle).forEach(([apiName, api]) => {
335-
Object.entries(api).forEach(([mediaType]) => {
334+
for (const [apiName, api] of Object.entries(this.plugin.settings.apiToggle)) {
335+
for (const mediaType of Object.keys(api)) {
336336
if (!mediaTypeApiMap.has(mediaType)) {
337337
mediaTypeApiMap.set(mediaType, []);
338338
}
339339
mediaTypeApiMap.get(mediaType)!.push(apiName);
340-
});
341-
});
340+
}
341+
}
342342

343343
// Filter out media types with only one API
344344
const filteredMediaTypes = Array.from(mediaTypeApiMap.entries()).filter(([_, apis]) => apis.length > 1);
345345

346346
// Dynamically create settings based on the filtered media types and their APIs
347-
filteredMediaTypes.forEach(([mediaType, apis]) => {
347+
for (const [mediaType, apis] of filteredMediaTypes) {
348348
new Setting(containerEl).setName(`Select APIs for ${unCamelCase(mediaType)}`).setHeading();
349-
apis.forEach(apiName => {
349+
for (const apiName of apis) {
350350
const apiToggle = this.plugin.settings.apiToggle[apiName as keyof typeof this.plugin.settings.apiToggle];
351351
new Setting(containerEl)
352352
.setName(apiName)
@@ -357,8 +357,8 @@ export class MediaDbSettingTab extends PluginSettingTab {
357357
void this.plugin.saveSettings();
358358
});
359359
});
360-
});
361-
});
360+
}
361+
}
362362

363363
new Setting(containerEl).setName('New file location').setHeading();
364364
// region new file location

0 commit comments

Comments
 (0)