File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ const hashToSegments = require('./util/hash-to-segments')
19
19
const indexV = require ( '../package.json' ) [ 'cache-version' ] . index
20
20
const { moveFile } = require ( '@npmcli/fs' )
21
21
22
- const pMap = require ( 'p-map' )
23
22
const lsStreamConcurrency = 5
24
23
25
24
module . exports . NotFoundError = class NotFoundError extends Error {
@@ -184,6 +183,7 @@ function lsStream (cache) {
184
183
185
184
// Set all this up to run on the stream and then just return the stream
186
185
Promise . resolve ( ) . then ( async ( ) => {
186
+ const { default : pMap } = await import ( 'p-map' )
187
187
const buckets = await readdirOrEmpty ( indexDir )
188
188
await pMap ( buckets , async ( bucket ) => {
189
189
const bucketPath = path . join ( indexDir , bucket )
Original file line number Diff line number Diff line change 8
8
truncate,
9
9
writeFile,
10
10
} = require ( 'fs/promises' )
11
- const pMap = require ( 'p-map' )
12
11
const contentPath = require ( './content/path' )
13
12
const fsm = require ( 'fs-minipass' )
14
13
const glob = require ( './util/glob.js' )
@@ -93,6 +92,7 @@ async function fixPerms (cache, opts) {
93
92
//
94
93
async function garbageCollect ( cache , opts ) {
95
94
opts . log . silly ( 'verify' , 'garbage collecting content' )
95
+ const { default : pMap } = await import ( 'p-map' )
96
96
const indexStream = index . lsStream ( cache )
97
97
const liveContent = new Set ( )
98
98
indexStream . on ( 'data' , ( entry ) => {
@@ -176,6 +176,7 @@ async function verifyContent (filepath, sri) {
176
176
177
177
async function rebuildIndex ( cache , opts ) {
178
178
opts . log . silly ( 'verify' , 'rebuilding index' )
179
+ const { default : pMap } = await import ( 'p-map' )
179
180
const entries = await index . ls ( cache )
180
181
const stats = {
181
182
missingContent : 0 ,
Original file line number Diff line number Diff line change 54
54
"minipass-collect" : " ^2.0.1" ,
55
55
"minipass-flush" : " ^1.0.5" ,
56
56
"minipass-pipeline" : " ^1.2.4" ,
57
- "p-map" : " ^4 .0.0 " ,
57
+ "p-map" : " ^7 .0.2 " ,
58
58
"ssri" : " ^12.0.0" ,
59
59
"tar" : " ^7.4.3" ,
60
60
"unique-filename" : " ^4.0.0"
You can’t perform that action at this time.
0 commit comments