Skip to content

Commit

Permalink
fixup! fix: prioritizedEntries class sort order
Browse files Browse the repository at this point in the history
  • Loading branch information
lundibundi committed Sep 14, 2020
1 parent 3824746 commit 44c3233
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/generator.js
Expand Up @@ -478,21 +478,21 @@ const sortMethods = (methods, prioritizedEntries) => {
return 0;
};
const other = Symbol('other');
const groupped = iter(methods).groupBy(
const grouped = iter(methods).groupBy(
([m]) =>
prioritizedEntries.find(e => m === e || m.startsWith(e + '.')) || other
);
let result = iter([]);
for (const p of prioritizedEntries) {
const entries = groupped.get(p);
const entries = grouped.get(p);
if (entries) {
const [other, sorted] = iter(entries).partition(
([m]) => !!prioritizedEntries.find(e => m === e)
);
result = result.chain(sorted.sort(sortFn)).chain(other);
}
}
result = result.chain(groupped.get(other));
result = result.chain(grouped.get(other));
return result.collectTo(Map);
};

Expand Down

0 comments on commit 44c3233

Please sign in to comment.