This commit is contained in:
Stefan Petrushevski
2023-11-13 17:45:48 +01:00
parent b99756ecd3
commit 152d8e2def

View File

@@ -1,7 +1,7 @@
import spdxSatisfies from 'spdx-satisfies'
import { Change, Changes } from './schemas'
import { isSPDXValid, octokitClient } from './utils'
import { PackageURL } from 'packageurl-js'
import {Change, Changes} from './schemas'
import {isSPDXValid, octokitClient} from './utils'
import {PackageURL} from 'packageurl-js'
/**
* Loops through a list of changes, filtering and returning the
@@ -29,7 +29,7 @@ export async function getInvalidLicenseChanges(
licenseExclusions?: string[]
}
): Promise<InvalidLicenseChanges> {
const { allow, deny } = licenses
const {allow, deny} = licenses
const licenseExclusions = licenses.licenseExclusions?.map(
(pkgUrl: string) => {
return PackageURL.fromString(encodeURI(pkgUrl))
@@ -127,7 +127,7 @@ const fetchGHLicense = async (
}
}
const parseGitHubURL = (url: string): { owner: string; repo: string } | null => {
const parseGitHubURL = (url: string): {owner: string; repo: string} | null => {
try {
const parsed = new URL(url)
if (parsed.host !== 'github.com') {
@@ -137,7 +137,7 @@ const parseGitHubURL = (url: string): { owner: string; repo: string } | null =>
if (components.length < 3) {
return null
}
return { owner: components[1], repo: components[2] }
return {owner: components[1], repo: components[2]}
} catch (_) {
return null
}