Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} else if (
opts.include.dependencies &&
opts.include.devDependencies &&
opts.include.optionalDependencies &&
opts.skipped.size === 0
) {
currentLockfile = newWantedLockfile
} else {
currentLockfile = newCurrentLockfile
}
let newHoistedAliases: {[depPath: string]: string[]} = {}
if (newDepPaths.length > 0 || removedDepPaths.size > 0) {
const rootImporterWithFlatModules = opts.hoistPattern && importers.find(({ id }) => id === '.')
if (rootImporterWithFlatModules) {
newHoistedAliases = await hoist(matcher(opts.hoistPattern!), {
getIndependentPackageLocation: opts.independentLeaves
? async (packageId: string, packageName: string) => {
const { dir } = await opts.storeController.getPackageLocation(packageId, packageName, {
lockfileDir: opts.lockfileDir,
targetEngine: opts.sideEffectsCacheRead && ENGINE_NAME || undefined,
})
return dir
}
: undefined,
lockfile: currentLockfile,
lockfileDir: opts.lockfileDir,
modulesDir: opts.hoistedModulesDir,
registries: opts.registries,
virtualStoreDir: opts.virtualStoreDir,
})
}