Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const linkingMap = dependenciesMap.reduce((obj, [path, deps]) => {
const name = packagesNames[packagesPaths.indexOf(path)]
if (name) {
obj[name] = {name, path, deps}
}
return obj
}, {})
const createCommandsForMap = createCommands(linkingMap)
const commands = Object.values(linkingMap).reduce(
(res, pkg) => [...res, ...createCommandsForMap(pkg)],
[]
)
// Execute commands
spawnList(commands, {}, 10)
.then(process.exit)
.catch(process.exit)