Skip to content

Commit e426a70

Browse files
committed
removed unused variables and fixed linting issue
1 parent a15746d commit e426a70

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

workspaces/arborist/lib/arborist/isolated-reifier.js

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const pacote = require('pacote')
66
const { join } = require('node:path')
77
const { depth } = require('treeverse')
88
const crypto = require('node:crypto')
9-
const path = require('node:path')
109

1110
// cache complicated function results
1211
const memoize = (fn) => {
@@ -82,7 +81,7 @@ module.exports = cls => class IsolatedReifier extends cls {
8281
}
8382
queue.push(e.to)
8483
})
85-
if (!next.isProjectRoot && !next.isWorkspace && !next.ideallyInert) {
84+
if (!next.isProjectRoot && !next.isWorkspace) {
8685
root.external.push(await this.externalProxyMemo(next))
8786
}
8887
}
@@ -150,8 +149,8 @@ module.exports = cls => class IsolatedReifier extends cls {
150149
const nonOptionalDeps = edges.filter(e => !e.optional).map(e => e.to.target)
151150

152151
result.localDependencies = await Promise.all(nonOptionalDeps.filter(n => n.isWorkspace).map(this.workspaceProxyMemo))
153-
result.externalDependencies = await Promise.all(nonOptionalDeps.filter(n => !n.isWorkspace && !n.ideallyInert).map(this.externalProxyMemo))
154-
result.externalOptionalDependencies = await Promise.all(optionalDeps.filter(n => !n.ideallyInert).map(this.externalProxyMemo))
152+
result.externalDependencies = await Promise.all(nonOptionalDeps.filter(n => !n.isWorkspace).map(this.externalProxyMemo))
153+
result.externalOptionalDependencies = await Promise.all(optionalDeps.map(this.externalProxyMemo))
155154
result.dependencies = [
156155
...result.externalDependencies,
157156
...result.localDependencies,
@@ -324,11 +323,11 @@ module.exports = cls => class IsolatedReifier extends cls {
324323
isRoot: false,
325324
isInStore: inStore,
326325
path: node.isLink ?
327-
join(proxiedIdealTree.root.localPath, node.locationPath || '', location) :
328-
join(proxiedIdealTree.root.localPath, location),
326+
join(proxiedIdealTree.root.localPath, node.localPath || '', location) :
327+
join(proxiedIdealTree.root.localPath, location),
329328
realpath: node.isLink ?
330-
join(proxiedIdealTree.root.localPath, node.locationPath || '', location) :
331-
join(proxiedIdealTree.root.localPath, location),
329+
join(proxiedIdealTree.root.localPath, node.localPath || '', location) :
330+
join(proxiedIdealTree.root.localPath, location),
332331
resolved: node.resolved,
333332
version: pkg.version,
334333
package: pkg,
@@ -375,8 +374,8 @@ module.exports = cls => class IsolatedReifier extends cls {
375374
} else {
376375
from = node.isProjectRoot ? root : root.fsChildren.find(c => c.location === node.localLocation)
377376
nmFolder = node.isLink ?
378-
join(proxiedIdealTree.root.localPath, node.localLocation || '', 'node_modules') :
379-
join(node.localLocation, 'node_modules')
377+
join(proxiedIdealTree.root.localPath, node.localLocation || '', 'node_modules') :
378+
join(node.localLocation, 'node_modules')
380379
}
381380

382381
const processDeps = (dep, optional, external) => {
@@ -386,7 +385,6 @@ module.exports = cls => class IsolatedReifier extends cls {
386385
const location = dep.isLink ?
387386
join(proxiedIdealTree.root.localPath, dep.localLocation || '', 'node_modules', dep.name) :
388387
join(nmFolder, dep.name)
389-
390388
const binNames = dep.package.bin && Object.keys(dep.package.bin) || []
391389
const toKey = getKey(dep)
392390

@@ -401,9 +399,9 @@ module.exports = cls => class IsolatedReifier extends cls {
401399

402400
binNames.forEach(bn => {
403401
const binPath = dep.isLink ?
404-
join(proxiedIdealTree.root.localPath, from.realpath, 'node_modules', '.bin' , bn) :
405-
join(from.realpath, 'node_modules', 'bin', bn)
406-
target.binpaths.push(binpath)
402+
join(proxiedIdealTree.root.localPath, from.realpath, 'node_modules', '.bin', bn) :
403+
join(from.realpath, 'node_modules', '.bin', bn)
404+
target.binPaths.push(binPath)
407405
})
408406

409407
const link = {

0 commit comments

Comments
 (0)