Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function getPackageLocation (
packageId: string,
packageName: string,
opts: {
lockfileDir: string,
targetEngine?: string,
}
) {
if (opts.targetEngine) {
const sideEffectsCacheLocation = (await getCacheByEngine(initOpts.storeDir, packageId))[opts.targetEngine]
if (sideEffectsCacheLocation) {
return {
dir: sideEffectsCacheLocation,
isBuilt: true,
}
}
}
return {
dir: path.join(initOpts.storeDir, pkgIdToFilename(packageId, opts.lockfileDir), 'node_modules', packageName),
isBuilt: false,
}
}