diff --git a/registry/index.js b/registry/index.js index 9bfa0f32..860309e2 100644 --- a/registry/index.js +++ b/registry/index.js @@ -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(