cacache
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -8,3 +8,3 @@ var checkSizeStream = require('../util/check-size-stream') | ||
var hasContent = require('./read').hasContent | ||
var move = require('../util/move') | ||
var moveFile = require('../util/move-file') | ||
var once = require('once') | ||
@@ -89,3 +89,3 @@ var path = require('path') | ||
if (err) { return cb(err) } | ||
move(tmpTarget, destination, function (err) { | ||
moveFile(tmpTarget, destination, function (err) { | ||
if (err) { return cb(err) } | ||
@@ -92,0 +92,0 @@ fixOwner.chownr(destination, opts.uid, opts.gid, cb) |
@@ -5,2 +5,3 @@ var through = require('mississippi').through | ||
function checkSizeStream (size) { | ||
if (size == null) { throw new Error('size is required') } | ||
var found = 0 | ||
@@ -11,13 +12,13 @@ var stream = through(function (chunk, enc, next) { | ||
}, function (cb) { | ||
if (size === found) { | ||
cb() | ||
} else { | ||
var err = new Error('stream data size mismatch') | ||
err.expected = size | ||
err.found = found | ||
err.code = 'EBADSIZE' | ||
return cb(err) | ||
} | ||
cb(size === found ? null : sizeError(size, found)) | ||
}) | ||
return stream | ||
} | ||
function sizeError (expected, found) { | ||
var err = new Error('stream data size mismatch') | ||
err.expected = expected | ||
err.found = found | ||
err.code = 'EBADSIZE' | ||
return err | ||
} |
{ | ||
"name": "cacache", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "General content-addressable cache system that maintains a filesystem registry of file data.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
33931
712
0