transforming package URLs during zod parsing

This commit is contained in:
Brandon Teng
2024-04-16 16:04:11 -05:00
parent a318e62c6c
commit 3ca15314ff
4 changed files with 11 additions and 32 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
import {PackageURL} from 'packageurl-js'
import {Change} from '../../src/schemas'
import {createTestVulnerability} from './create-test-vulnerability'
import {parseGroupPURL} from '../../src/utils'
import {parsePURL} from '../../src/utils'
const defaultNpmChange: Change = {
change_type: 'added',
@@ -127,7 +127,7 @@ const createTestPackagePURLs = (list: string[]): PackageURL[] => {
const createTestGroupPURLs = (list: string[]): PackageURL[] => {
return list
.map(purl => {
return parseGroupPURL(purl)
return parsePURL(purl)
})
.filter((purl): purl is PackageURL => purl !== undefined)
}