Skip to content

Commit 97f67e5

Browse files
committed
simplify
1 parent bc75566 commit 97f67e5

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

packages/cli/lib/install.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,7 @@ async function runAddon({ addon, multiple, workspace }: RunAddon) {
184184
// This is a drastic simplification, as this could still cause some inconvenient cituations,
185185
// but works for now in contrary to the previouse implementation
186186
function orderAddons(addons: Array<Addon<any>>, setupResults: Record<string, AddonSetupResult>) {
187-
return addons.sort((a, b) => {
188-
const aDepends = setupResults[a.id]?.dependsOn?.length > 0;
189-
const bDepends = setupResults[b.id]?.dependsOn?.length > 0;
190-
191-
if (aDepends && !bDepends) return 1;
192-
if (!aDepends && bDepends) return -1;
193-
return 0;
194-
});
187+
return addons.sort(
188+
(a, b) => setupResults[a.id]?.dependsOn?.length - setupResults[b.id]?.dependsOn?.length
189+
);
195190
}

0 commit comments

Comments
 (0)