mirror of
https://git.bits.team/Bits/mod-manager.git
synced 2024-11-23 14:38:21 -05:00
Use .find instead of .filter()[i]
This commit is contained in:
parent
c0f6be93c7
commit
562b43e0b0
@ -203,7 +203,7 @@ export default class Mods {
|
||||
}
|
||||
|
||||
static getSourceFromName(name: string): ModSource {
|
||||
const source = this.MOD_SOURCES.filter(src => src.getSourceName() === name)[0];
|
||||
const source = this.MOD_SOURCES.find(src => src.getSourceName() === name);
|
||||
if (source == undefined) {
|
||||
throw new Error(`There is no source registered with the name ${name}`)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user