Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: update p-map from ^4.0.0 to ^7.0.2 #302

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/entry-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const hashToSegments = require('./util/hash-to-segments')
const indexV = require('../package.json')['cache-version'].index
const { moveFile } = require('@npmcli/fs')

const pMap = require('p-map')
const lsStreamConcurrency = 5

module.exports.NotFoundError = class NotFoundError extends Error {
Expand Down Expand Up @@ -184,6 +183,7 @@ function lsStream (cache) {

// Set all this up to run on the stream and then just return the stream
Promise.resolve().then(async () => {
const { default: pMap } = await import('p-map')
const buckets = await readdirOrEmpty(indexDir)
await pMap(buckets, async (bucket) => {
const bucketPath = path.join(indexDir, bucket)
Expand Down
3 changes: 2 additions & 1 deletion lib/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const {
truncate,
writeFile,
} = require('fs/promises')
const pMap = require('p-map')
const contentPath = require('./content/path')
const fsm = require('fs-minipass')
const glob = require('./util/glob.js')
Expand Down Expand Up @@ -93,6 +92,7 @@ async function fixPerms (cache, opts) {
//
async function garbageCollect (cache, opts) {
opts.log.silly('verify', 'garbage collecting content')
const { default: pMap } = await import('p-map')
const indexStream = index.lsStream(cache)
const liveContent = new Set()
indexStream.on('data', (entry) => {
Expand Down Expand Up @@ -176,6 +176,7 @@ async function verifyContent (filepath, sri) {

async function rebuildIndex (cache, opts) {
opts.log.silly('verify', 'rebuilding index')
const { default: pMap } = await import('p-map')
const entries = await index.ls(cache)
const stats = {
missingContent: 0,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"minipass-collect": "^2.0.1",
"minipass-flush": "^1.0.5",
"minipass-pipeline": "^1.2.4",
"p-map": "^4.0.0",
"p-map": "^7.0.2",
"ssri": "^12.0.0",
"tar": "^7.4.3",
"unique-filename": "^4.0.0"
Expand Down