Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const addLinkOpts = {
linkedPkgName: linkFromAlias || manifest.name,
manifest: ctx.manifest,
packagePath,
}
addLinkToLockfile(ctx.currentLockfile.importers[importerId], addLinkOpts)
addLinkToLockfile(ctx.wantedLockfile.importers[importerId], addLinkOpts)
linkedPkgs.push({
alias: linkFromAlias || manifest.name,
manifest,
path: linkFromPath,
})
}
const updatedCurrentLockfile = pruneSharedLockfile(ctx.currentLockfile)
const warn = (message: string) => logger.warn({ message, prefix: opts.dir })
const updatedWantedLockfile = pruneSharedLockfile(ctx.wantedLockfile, { warn })
await prune(
[
{
binsDir: opts.binsDir,
id: importerId,
modulesDir: ctx.modulesDir,
rootDir: opts.dir,
},
],
{
currentLockfile,
hoistedAliases: ctx.hoistedAliases,
packagePath,
}
addLinkToLockfile(ctx.currentLockfile.importers[importerId], addLinkOpts)
addLinkToLockfile(ctx.wantedLockfile.importers[importerId], addLinkOpts)
linkedPkgs.push({
alias: linkFromAlias || manifest.name,
manifest,
path: linkFromPath,
})
}
const updatedCurrentLockfile = pruneSharedLockfile(ctx.currentLockfile)
const warn = (message: string) => logger.warn({ message, prefix: opts.dir })
const updatedWantedLockfile = pruneSharedLockfile(ctx.wantedLockfile, { warn })
await prune(
[
{
binsDir: opts.binsDir,
id: importerId,
modulesDir: ctx.modulesDir,
rootDir: opts.dir,
},
],
{
currentLockfile,
hoistedAliases: ctx.hoistedAliases,
hoistedModulesDir: opts.hoistPattern && ctx.hoistedModulesDir || undefined,
include: ctx.include,
lockfileDir: opts.lockfileDir,
Object.keys(depNode.children).map((alias) => ({ alias, depPath: depNode.children[alias] })),
)
lockfile.packages[relDepPath] = toLockfileDependency(pendingRequiresBuilds, depNode.additionalInfo, {
depGraph,
depPath,
prevSnapshot: lockfile.packages[relDepPath],
registries,
registry: dp.getRegistryByPackageName(registries, depNode.name),
relDepPath,
updatedDeps: result[1],
updatedOptionalDeps: result[0],
})
}
const warn = (message: string) => logger.warn({ message, prefix })
return {
newLockfile: pruneSharedLockfile(lockfile, { warn }),
pendingRequiresBuilds,
}
}