Skip to content

Commit

Permalink
Merge pull request #203 from opentofu/use-es-toolkit
Browse files Browse the repository at this point in the history
  • Loading branch information
Yantrio authored Sep 10, 2024
2 parents 938ff70 + e4ccd91 commit ca7dab8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
11 changes: 11 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@vitejs/plugin-react": "^4.3.1",
"autoprefixer": "^10.4.20",
"clsx": "^2.1.1",
"es-toolkit": "^1.17.0",
"eslint": "^9.9.1",
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.11",
Expand Down
6 changes: 2 additions & 4 deletions frontend/src/components/LicenseSidebarBlock/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Fragment, ReactNode } from "react";
import { definitions } from "@/api";
import { Icon } from "../Icon";
import { info } from "@/icons/info";
import { groupBy } from "es-toolkit";

interface BlockProps {
license?: definitions["LicenseList"];
Expand Down Expand Up @@ -33,10 +34,7 @@ export function LicenseSidebarBlock(props: BlockProps) {
(a, b) => b.confidence - a.confidence,
);

const groupedLicenses = Object.groupBy(
sortedLicenses,
(license) => license.link,
);
const groupedLicenses = groupBy(sortedLicenses, (license) => license.link);

const licenses = Object.entries(groupedLicenses).map(([link, license]) => (
<li className="flex flex-col items-start gap-2" key={link}>
Expand Down

0 comments on commit ca7dab8

Please sign in to comment.