summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/cacache/lib/content
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/cacache/lib/content')
-rw-r--r--deps/npm/node_modules/cacache/lib/content/path.js2
-rw-r--r--deps/npm/node_modules/cacache/lib/content/read.js12
-rw-r--r--deps/npm/node_modules/cacache/lib/content/write.js8
3 files changed, 11 insertions, 11 deletions
diff --git a/deps/npm/node_modules/cacache/lib/content/path.js b/deps/npm/node_modules/cacache/lib/content/path.js
index fa6491ba6f..c67c280612 100644
--- a/deps/npm/node_modules/cacache/lib/content/path.js
+++ b/deps/npm/node_modules/cacache/lib/content/path.js
@@ -12,7 +12,7 @@ const ssri = require('ssri')
//
module.exports = contentPath
function contentPath (cache, integrity) {
- const sri = ssri.parse(integrity, {single: true})
+ const sri = ssri.parse(integrity, { single: true })
// contentPath is the *strongest* algo given
return path.join.apply(path, [
contentDir(cache),
diff --git a/deps/npm/node_modules/cacache/lib/content/read.js b/deps/npm/node_modules/cacache/lib/content/read.js
index 8f1acc06d8..7929524f82 100644
--- a/deps/npm/node_modules/cacache/lib/content/read.js
+++ b/deps/npm/node_modules/cacache/lib/content/read.js
@@ -54,8 +54,8 @@ function readStream (cache, integrity, opts) {
opts = ReadOpts(opts)
const stream = new PassThrough()
withContentSri(cache, integrity, (cpath, sri) => {
- return lstatAsync(cpath).then(stat => ({cpath, sri, stat}))
- }).then(({cpath, sri, stat}) => {
+ return lstatAsync(cpath).then(stat => ({ cpath, sri, stat }))
+ }).then(({ cpath, sri, stat }) => {
return pipe(
fs.createReadStream(cpath),
ssri.integrityStream({
@@ -95,7 +95,7 @@ module.exports.hasContent = hasContent
function hasContent (cache, integrity) {
if (!integrity) { return BB.resolve(false) }
return withContentSri(cache, integrity, (cpath, sri) => {
- return lstatAsync(cpath).then(stat => ({size: stat.size, sri, stat}))
+ return lstatAsync(cpath).then(stat => ({ size: stat.size, sri, stat }))
}).catch(err => {
if (err.code === 'ENOENT') { return false }
if (err.code === 'EPERM') {
@@ -114,7 +114,7 @@ function hasContentSync (cache, integrity) {
return withContentSriSync(cache, integrity, (cpath, sri) => {
try {
const stat = fs.lstatSync(cpath)
- return {size: stat.size, sri, stat}
+ return { size: stat.size, sri, stat }
} catch (err) {
if (err.code === 'ENOENT') { return false }
if (err.code === 'EPERM') {
@@ -141,12 +141,12 @@ function withContentSri (cache, integrity, fn) {
} else {
return BB.any(sri[sri.pickAlgorithm()].map(meta => {
return withContentSri(cache, meta, fn)
- }, {concurrency: 1}))
+ }, { concurrency: 1 }))
.catch(err => {
if ([].some.call(err, e => e.code === 'ENOENT')) {
throw Object.assign(
new Error('No matching content found for ' + sri.toString()),
- {code: 'ENOENT'}
+ { code: 'ENOENT' }
)
} else {
throw err[0]
diff --git a/deps/npm/node_modules/cacache/lib/content/write.js b/deps/npm/node_modules/cacache/lib/content/write.js
index c71363413c..150371cb85 100644
--- a/deps/npm/node_modules/cacache/lib/content/write.js
+++ b/deps/npm/node_modules/cacache/lib/content/write.js
@@ -36,11 +36,11 @@ function write (cache, data, opts) {
}
return BB.using(makeTmp(cache, opts), tmp => (
writeFileAsync(
- tmp.target, data, {flag: 'wx'}
+ tmp.target, data, { flag: 'wx' }
).then(() => (
moveToDestination(tmp, cache, sri, opts)
))
- )).then(() => ({integrity: sri, size: data.length}))
+ )).then(() => ({ integrity: sri, size: data.length }))
}
module.exports.stream = writeStream
@@ -111,8 +111,8 @@ function pipeToTmp (inputStream, cache, tmpTarget, opts, errCheck) {
})
errCheck()
return pipe(inputStream, hashStream, outStream).then(() => {
- return {integrity, size}
- }, err => {
+ return { integrity, size }
+ }).catch(err => {
return rimraf(tmpTarget).then(() => { throw err })
})
})