refactor: remove optional chaining as modules is always returned as an array

This commit is contained in:
fernandomg 2020-07-17 11:10:27 -03:00
parent 1ccb37e031
commit 95e557b133
1 changed files with 2 additions and 2 deletions

View File

@ -39,8 +39,8 @@ const buildOwnersFrom = (
})
})
const buildModulesLinkedList = (modules: Array<string>, nextModule: string): Array<ModulePair> | null => {
if (modules?.length) {
const buildModulesLinkedList = (modules: string[], nextModule: string): Array<ModulePair> | null => {
if (modules.length) {
return modules.map((moduleAddress, index, modules) => {
const prevModule = modules[index + 1]
return [moduleAddress, prevModule !== undefined ? prevModule : nextModule]