Skip to content

Commit

Permalink
fixup! deps: @npmcli/fs@3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Nov 7, 2022
1 parent abcec7a commit 3117a36
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion workspaces/arborist/lib/arborist/build-ideal-tree.js
Expand Up @@ -454,7 +454,7 @@ module.exports = cls => class IdealTreeBuilder extends cls {
if (updateName) {
globalExplicitUpdateNames.push(name)
}
const dir = resolve(nm, namePath)
const dir = resolve(nm, name)
const st = await lstat(dir)
.catch(/* istanbul ignore next */ er => null)
if (st && st.isSymbolicLink()) {
Expand Down
8 changes: 4 additions & 4 deletions workspaces/arborist/lib/arborist/load-actual.js
@@ -1,6 +1,6 @@
// mix-in implementing the loadActual method

const { relative, dirname, resolve, join, normalize } = require('path')
const { relative, dirname, resolve, join, normalize, posix } = require('path')

const rpj = require('read-package-json-fast')
const { readdirScoped } = require('@npmcli/fs')
Expand Down Expand Up @@ -361,7 +361,7 @@ module.exports = cls => class ActualLoader extends cls {
async [_loadFSChildren] (node) {
const nm = resolve(node.realpath, 'node_modules')
try {
const kids = await readdirScoped(nm)
const kids = await readdirScoped(nm).then(list => list.map(i => posix.join(i)))
return Promise.all(
// ignore . dirs and retired scoped package folders
kids.filter(kid => !/^(@[^/]+\/)?\./.test(kid))
Expand Down Expand Up @@ -410,8 +410,8 @@ module.exports = cls => class ActualLoader extends cls {
break
}

const entries = nmContents.get(p) ||
await readdirScoped(p + '/node_modules').catch(() => [])
const entries = nmContents.get(p) || await readdirScoped(p + '/node_modules')
.catch(() => []).then(list => list.map(i => posix.join(i)))
nmContents.set(p, entries)
if (!entries.includes(name)) {
continue
Expand Down

0 comments on commit 3117a36

Please sign in to comment.