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')
1919const indexV = require ( '../package.json' ) [ 'cache-version' ] . index
2020const { moveFile } = require ( '@npmcli/fs' )
2121
22- const pMap = require ( 'p-map' )
2322const lsStreamConcurrency = 5
2423
2524module . exports . NotFoundError = class NotFoundError extends Error {
@@ -184,6 +183,7 @@ function lsStream (cache) {
184183
185184 // Set all this up to run on the stream and then just return the stream
186185 Promise . resolve ( ) . then ( async ( ) => {
186+ const { default : pMap } = await import ( 'p-map' )
187187 const buckets = await readdirOrEmpty ( indexDir )
188188 await pMap ( buckets , async ( bucket ) => {
189189 const bucketPath = path . join ( indexDir , bucket )
Original file line number Diff line number Diff line change 88 truncate,
99 writeFile,
1010} = require ( 'fs/promises' )
11- const pMap = require ( 'p-map' )
1211const contentPath = require ( './content/path' )
1312const fsm = require ( 'fs-minipass' )
1413const glob = require ( './util/glob.js' )
@@ -93,6 +92,7 @@ async function fixPerms (cache, opts) {
9392//
9493async function garbageCollect ( cache , opts ) {
9594 opts . log . silly ( 'verify' , 'garbage collecting content' )
95+ const { default : pMap } = await import ( 'p-map' )
9696 const indexStream = index . lsStream ( cache )
9797 const liveContent = new Set ( )
9898 indexStream . on ( 'data' , ( entry ) => {
@@ -176,6 +176,7 @@ async function verifyContent (filepath, sri) {
176176
177177async function rebuildIndex ( cache , opts ) {
178178 opts . log . silly ( 'verify' , 'rebuilding index' )
179+ const { default : pMap } = await import ( 'p-map' )
179180 const entries = await index . ls ( cache )
180181 const stats = {
181182 missingContent : 0 ,
Original file line number Diff line number Diff line change 5454 "minipass-collect" : " ^2.0.1" ,
5555 "minipass-flush" : " ^1.0.5" ,
5656 "minipass-pipeline" : " ^1.2.4" ,
57- "p-map" : " ^4 .0.0 " ,
57+ "p-map" : " ^7 .0.2 " ,
5858 "ssri" : " ^12.0.0" ,
5959 "tar" : " ^7.4.3" ,
6060 "unique-filename" : " ^4.0.0"
You can’t perform that action at this time.
0 commit comments