@parcel/fs-write-stream-atomic
Advanced tools
Comparing version 2.5.1-nightly.2713 to 2.5.1-nightly.2714
18
index.js
@@ -67,3 +67,3 @@ var fs = require('graceful-fs'); | ||
// target stream is closed and we've moved everything around. | ||
WriteStreamAtomic.prototype.emit = function(event) { | ||
WriteStreamAtomic.prototype.emit = function (event) { | ||
if (event === 'finish') return this.__atomicStream.end(); | ||
@@ -73,3 +73,3 @@ return Writable.prototype.emit.apply(this, arguments); | ||
WriteStreamAtomic.prototype._write = function(buffer, encoding, cb) { | ||
WriteStreamAtomic.prototype._write = function (buffer, encoding, cb) { | ||
var flushed = this.__atomicStream.write(buffer, encoding); | ||
@@ -81,3 +81,3 @@ if (flushed) return cb(); | ||
function handleOpen(writeStream) { | ||
return function(fd) { | ||
return function (fd) { | ||
writeStream.emit('open', fd); | ||
@@ -88,3 +88,3 @@ }; | ||
function handleClose(writeStream) { | ||
return function() { | ||
return function () { | ||
if (writeStream.__atomicClosed) return; | ||
@@ -134,3 +134,3 @@ writeStream.__atomicClosed = true; | ||
fs.createReadStream(writeStream.__atomicTmp) | ||
.on('data', function(data, enc) { | ||
.on('data', function (data, enc) { | ||
tmpFileHash.update(data, enc); | ||
@@ -141,3 +141,3 @@ }) | ||
fs.createReadStream(writeStream.__atomicTarget) | ||
.on('data', function(data, enc) { | ||
.on('data', function (data, enc) { | ||
targetFileHash.update(data, enc); | ||
@@ -166,3 +166,3 @@ }) | ||
function cleanup(err) { | ||
fs.unlink(writeStream.__atomicTmp, function() { | ||
fs.unlink(writeStream.__atomicTmp, function () { | ||
if (err) { | ||
@@ -185,3 +185,3 @@ writeStream.emit('error', err); | ||
// after the async close operation completes. | ||
setImmediate(function() { | ||
setImmediate(function () { | ||
writeStream.emit('close'); | ||
@@ -193,3 +193,3 @@ }); | ||
function handleError(writeStream) { | ||
return function(er) { | ||
return function (er) { | ||
cleanupSync(); | ||
@@ -196,0 +196,0 @@ writeStream.emit('error', er); |
{ | ||
"name": "@parcel/fs-write-stream-atomic", | ||
"version": "2.5.1-nightly.2713+e68beeb5b", | ||
"version": "2.5.1-nightly.2714+38bb2eefb", | ||
"description": "Like `fs.createWriteStream(...)`, but atomic.", | ||
@@ -28,3 +28,3 @@ "main": "index.js", | ||
"license": "ISC", | ||
"gitHead": "e68beeb5bbb4721a3bab306df8cb82f90cf3eb6a" | ||
"gitHead": "38bb2eefbe74b469afb6d427a3c4cb85a6d6c9ed" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
20231