🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

cacache

Package Overview
Dependencies
Maintainers
1
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cacache - npm Package Compare versions

Comparing version

to
3.0.1

lib/util/move-file.js

4

lib/content/put-stream.js

@@ -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",