Skip to content

Commit

Permalink
deps: cacache@18.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed Jan 9, 2024
1 parent 796d1c7 commit 8495b7c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
17 changes: 8 additions & 9 deletions node_modules/cacache/lib/content/read.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,20 @@ async function read (cache, integrity, opts = {}) {
const { size } = opts
const { stat, cpath, sri } = await withContentSri(cache, integrity, async (cpath, sri) => {
// get size
const stat = await fs.stat(cpath)
const stat = size ? { size } : await fs.stat(cpath)
return { stat, cpath, sri }
})
if (typeof size === 'number' && stat.size !== size) {
throw sizeError(size, stat.size)
}

if (stat.size > MAX_SINGLE_READ_SIZE) {
return readPipeline(cpath, stat.size, sri, new Pipeline()).concat()
}

const data = await fs.readFile(cpath, { encoding: null })

if (stat.size !== data.length) {
throw sizeError(stat.size, data.length)
}

if (!ssri.checkData(data, sri)) {
throw integrityError(sri, cpath)
}
Expand Down Expand Up @@ -55,13 +57,10 @@ function readStream (cache, integrity, opts = {}) {
// Set all this up to run on the stream and then just return the stream
Promise.resolve().then(async () => {
const { stat, cpath, sri } = await withContentSri(cache, integrity, async (cpath, sri) => {
// just stat to ensure it exists
const stat = await fs.stat(cpath)
// get size
const stat = size ? { size } : await fs.stat(cpath)
return { stat, cpath, sri }
})
if (typeof size === 'number' && size !== stat.size) {
return stream.emit('error', sizeError(size, stat.size))
}

return readPipeline(cpath, stat.size, sri, stream)
}).catch(err => stream.emit('error', err))
Expand Down
8 changes: 4 additions & 4 deletions node_modules/cacache/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cacache",
"version": "18.0.1",
"version": "18.0.2",
"cache-version": {
"content": "2",
"index": "5"
Expand All @@ -16,7 +16,7 @@
"snap": "tap",
"coverage": "tap",
"test-docker": "docker run -it --rm --name pacotest -v \"$PWD\":/tmp -w /tmp node:latest npm test",
"lint": "eslint \"**/*.js\"",
"lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
"npmclilint": "npmcli-lint",
"lintfix": "npm run lint -- --fix",
"postsnap": "npm run lintfix --",
Expand Down Expand Up @@ -60,7 +60,7 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.19.0",
"@npmcli/template-oss": "4.21.3",
"tap": "^16.0.0"
},
"engines": {
Expand All @@ -69,7 +69,7 @@
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"windowsCI": false,
"version": "4.19.0",
"version": "4.21.3",
"publish": "true"
},
"author": "GitHub Inc.",
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"@sigstore/tuf": "^2.2.0",
"abbrev": "^2.0.0",
"archy": "~1.0.0",
"cacache": "^18.0.1",
"cacache": "^18.0.2",
"chalk": "^5.3.0",
"ci-info": "^4.0.0",
"cli-columns": "^4.0.0",
Expand Down Expand Up @@ -3109,9 +3109,9 @@
}
},
"node_modules/cacache": {
"version": "18.0.1",
"resolved": "https://registry.npmjs.org/cacache/-/cacache-18.0.1.tgz",
"integrity": "sha512-g4Uf2CFZPaxtJKre6qr4zqLDOOPU7bNVhWjlNhvzc51xaTOx2noMOLhfFkTAqwtrAZAKQUuDfyjitzilpA8WsQ==",
"version": "18.0.2",
"resolved": "https://registry.npmjs.org/cacache/-/cacache-18.0.2.tgz",
"integrity": "sha512-r3NU8h/P+4lVUHfeRw1dtgQYar3DZMm4/cm2bZgOvrFC/su7budSOeqh52VJIC4U4iG1WWwV6vRW0znqBvxNuw==",
"inBundle": true,
"dependencies": {
"@npmcli/fs": "^3.1.0",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"@sigstore/tuf": "^2.2.0",
"abbrev": "^2.0.0",
"archy": "~1.0.0",
"cacache": "^18.0.1",
"cacache": "^18.0.2",
"chalk": "^5.3.0",
"ci-info": "^4.0.0",
"cli-columns": "^4.0.0",
Expand Down

0 comments on commit 8495b7c

Please sign in to comment.