Skip to content

Commit 6946b52

Browse files
committed
fixup! deps: @npmcli/[email protected]
1 parent 6cf597a commit 6946b52

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

lib/utils/completion/installed-shallow.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
const { readdirScoped } = require('@npmcli/fs')
2-
const { posix } = require('path')
32

43
const installedShallow = async (npm, opts) => {
5-
const names = global => readdirScoped(global ? npm.globalDir : npm.localDir)
6-
.then(list => list.map(i => posix.join(i)))
4+
const names = async global => {
5+
const paths = await readdirScoped(global ? npm.globalDir : npm.localDir)
6+
return paths.map(p => p.replace(/\\/g, '/'))
7+
}
78
const { conf: { argv: { remain } } } = opts
89
if (remain.length > 3) {
910
return null

workspaces/arborist/lib/arborist/build-ideal-tree.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const pacote = require('pacote')
66
const cacache = require('cacache')
77
const promiseCallLimit = require('promise-call-limit')
88
const realpath = require('../../lib/realpath.js')
9-
const { resolve, dirname, posix } = require('path')
9+
const { resolve, dirname } = require('path')
1010
const treeCheck = require('../tree-check.js')
1111
const { readdirScoped } = require('@npmcli/fs')
1212
const { lstat, readlink } = require('fs/promises')
@@ -446,8 +446,8 @@ module.exports = cls => class IdealTreeBuilder extends cls {
446446
const globalExplicitUpdateNames = []
447447
if (this[_global] && (this[_updateAll] || this[_updateNames].length)) {
448448
const nm = resolve(this.path, 'node_modules')
449-
for (const namePath of await readdirScoped(nm).catch(() => [])) {
450-
const name = posix.join(namePath)
449+
const paths = await readdirScoped(nm).catch(() => [])
450+
for (const name of paths.map((p) => p.replace(/\\/g, '/'))) {
451451
tree.package.dependencies = tree.package.dependencies || {}
452452
const updateName = this[_updateNames].includes(name)
453453
if (this[_updateAll] || updateName) {

workspaces/arborist/lib/arborist/load-actual.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// mix-in implementing the loadActual method
22

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

55
const rpj = require('read-package-json-fast')
66
const { readdirScoped } = require('@npmcli/fs')
@@ -361,7 +361,7 @@ module.exports = cls => class ActualLoader extends cls {
361361
async [_loadFSChildren] (node) {
362362
const nm = resolve(node.realpath, 'node_modules')
363363
try {
364-
const kids = await readdirScoped(nm).then(list => list.map(i => posix.join(i)))
364+
const kids = await readdirScoped(nm).then(paths => paths.map(p => p.replace(/\\/g, '/')))
365365
return Promise.all(
366366
// ignore . dirs and retired scoped package folders
367367
kids.filter(kid => !/^(@[^/]+\/)?\./.test(kid))
@@ -411,7 +411,7 @@ module.exports = cls => class ActualLoader extends cls {
411411
}
412412

413413
const entries = nmContents.get(p) || await readdirScoped(p + '/node_modules')
414-
.catch(() => []).then(list => list.map(i => posix.join(i)))
414+
.catch(() => []).then(paths => paths.map(p => p.replace(/\\/g, '/')))
415415
nmContents.set(p, entries)
416416
if (!entries.includes(name)) {
417417
continue

0 commit comments

Comments
 (0)