Skip to content

Commit

Permalink
replace orderBy with toSorted
Browse files Browse the repository at this point in the history
  • Loading branch information
vorant94 committed Apr 21, 2024
1 parent db861b0 commit fdc0c73
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/blog/src/projects/handlers/projects.handler.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { FastifyPluginAsync } from 'fastify';
import { groupBy, orderBy } from 'lodash-es';
import { groupBy } from 'lodash-es';
import { contentType, statusCode } from '../../http/index.js';
import { DefaultLayout, render } from '../../ui/index.js';
import { ProjectTiledList } from '../components/ProjectTiledList.js';
Expand Down Expand Up @@ -27,10 +27,9 @@ export const projectsHandler: FastifyPluginAsync = async function (app) {
(project) => project.matter.status,
);

const statuses = orderBy(
Object.keys(projectsByStatus) as ProjectStatus[],
(status) => projectStatusOrder[status],
);
const statuses = (
Object.keys(projectsByStatus) as ProjectStatus[]
).toSorted((a, b) => projectStatusOrder[a] - projectStatusOrder[b]);

const changelogsByProject = groupBy(allChangelogs, (changelog) =>
getProjectIdFromChangelogPath(changelog.path),
Expand Down

0 comments on commit fdc0c73

Please sign in to comment.