Skip to content

Commit

Permalink
define proper types in util
Browse files Browse the repository at this point in the history
  • Loading branch information
rajku-dev committed Feb 15, 2025
1 parent 0e40a64 commit f1317a6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pages/Licenses/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { PackageType } from "@/types/license";
import { LicensesSbom, PackageType } from "@/types/license";

export const getPackageUrl = (pkgName: string, purl: string): string => {
export const getPackageUrl = (
pkgName: LicensesSbom["sbom"]["packages"][number]["name"],
purl: LicensesSbom["sbom"]["packages"][number]["externalRefs"][number]["referenceLocator"],
): string => {
if (!purl || !pkgName) return "";

const urlMap: Record<PackageType, string> = {
Expand Down

0 comments on commit f1317a6

Please sign in to comment.