Skip to content

Commit

Permalink
Defer PackageURL in registry/index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Jan 1, 2025
1 parent 7118173 commit f303d8f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion registry/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
'use strict'

const { PackageURL } = require('packageurl-js')
let _PackageURL
function getPackageURL() {
if (_PackageURL === undefined) {
const id = 'packageurl-js'
_PackageURL = require(id).PackageURL
}
return _PackageURL
}

function getManifestData(eco, regPkgName) {
const registryManifest = require('./manifest.json')
if (eco) {
const PackageURL = getPackageURL()
const entries = registryManifest[eco]
return regPkgName
? entries?.find(
Expand Down

0 comments on commit f303d8f

Please sign in to comment.