Use SPDX license expressions

This commit is contained in:
cnagadya
2022-10-26 09:56:34 +00:00
parent 024a5a6342
commit ac5ed8754d
5 changed files with 2957 additions and 3187 deletions
+10
View File
@@ -1,3 +1,4 @@
import spdxParse from 'spdx-expression-parse'
import {Changes} from './schemas'
export function groupDependenciesByManifest(
@@ -28,3 +29,12 @@ export function renderUrl(url: string | null, text: string): string {
return text
}
}
export function isSPDXValid(license: string): boolean {
try {
spdxParse(license)
return true
} catch (_) {
return false
}
}