Skip to content

Commit 0ec2850

Browse files
committed
refactor: change if-else to ternary operator
1 parent 96d5018 commit 0ec2850

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

dist/bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils/LookmlDiagrammer/utils.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -315,12 +315,9 @@ export function getJoinedViewsForViews(
315315
const aLength = diagramDict.tableData[aName]?.length ?? 0
316316
const bLength = diagramDict.tableData[bName]?.length ?? 0
317317

318-
if (aIndex < bIndex) {
319-
return -1
320-
} else if (aIndex === bIndex && aLength < bLength) {
321-
return -1
322-
}
323-
return 1
318+
return aIndex < bIndex || (aIndex === bIndex && aLength < bLength)
319+
? -1
320+
: 1
324321
})
325322
scaffold[viewName] = joined
326323
})

0 commit comments

Comments
 (0)