fs-capacitor
Advanced tools
Comparing version 6.1.0 to 6.2.0
@@ -88,1 +88,6 @@ # fs-capacitor changelog | ||
- Add documentation of configuration options to README. | ||
### 6.2.0 | ||
- Upgrade dependencies. | ||
- Update option types to match changes in @types/node. |
@@ -6,2 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.WriteStream = exports.ReadStream = exports.ReadAfterReleasedError = exports.ReadAfterDestroyedError = void 0; | ||
const crypto_1 = __importDefault(require("crypto")); | ||
@@ -20,7 +21,6 @@ const fs_1 = __importDefault(require("fs")); | ||
constructor(writeStream, options) { | ||
var _a, _b; | ||
super({ | ||
highWaterMark: (_a = options) === null || _a === void 0 ? void 0 : _a.highWaterMark, | ||
encoding: (_b = options) === null || _b === void 0 ? void 0 : _b.encoding, | ||
autoDestroy: true | ||
highWaterMark: options === null || options === void 0 ? void 0 : options.highWaterMark, | ||
encoding: options === null || options === void 0 ? void 0 : options.encoding, | ||
autoDestroy: true, | ||
}); | ||
@@ -39,3 +39,3 @@ this._pos = 0; | ||
// `bytesRead`, and discard the rest. This prevents node from having to zero | ||
// out the enture allocation first. | ||
// out the entire allocation first. | ||
const buf = Buffer.allocUnsafe(n); | ||
@@ -71,7 +71,6 @@ fs_1.default.read(this._writeStream["_fd"], buf, 0, n, this._pos, (error, bytesRead) => { | ||
constructor(options) { | ||
var _a, _b; | ||
super({ | ||
highWaterMark: (_a = options) === null || _a === void 0 ? void 0 : _a.highWaterMark, | ||
defaultEncoding: (_b = options) === null || _b === void 0 ? void 0 : _b.defaultEncoding, | ||
autoDestroy: false | ||
highWaterMark: options === null || options === void 0 ? void 0 : options.highWaterMark, | ||
defaultEncoding: options === null || options === void 0 ? void 0 : options.defaultEncoding, | ||
autoDestroy: false, | ||
}); | ||
@@ -134,3 +133,3 @@ this._fd = null; | ||
} | ||
fs_1.default.write(this._fd, chunk, 0, chunk.length, this._pos, error => { | ||
fs_1.default.write(this._fd, chunk, 0, chunk.length, this._pos, (error) => { | ||
if (error) { | ||
@@ -165,6 +164,6 @@ callback(error); | ||
// Close the file descriptor. | ||
fs_1.default.close(fd, closeError => { | ||
fs_1.default.close(fd, (closeError) => { | ||
// An error here probably means the fd was already closed, but we can | ||
// still try to unlink the file. | ||
fs_1.default.unlink(path, unlinkError => { | ||
fs_1.default.unlink(path, (unlinkError) => { | ||
// If we are unable to unlink the file, the operating system will | ||
@@ -206,4 +205,4 @@ // clean up on next restart, since we use store thes in `os.tmpdir()` | ||
ReadAfterDestroyedError, | ||
ReadAfterReleasedError | ||
ReadAfterReleasedError, | ||
}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "fs-capacitor", | ||
"version": "6.1.0", | ||
"version": "6.2.0", | ||
"description": "Filesystem-buffered, passthrough stream that buffers indefinitely rather than propagate backpressure from downstream consumers.", | ||
@@ -29,11 +29,11 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "^2.14.0", | ||
"@typescript-eslint/parser": "^2.14.0", | ||
"ava": "^2.4.0", | ||
"eslint": "^6.8.0", | ||
"eslint-config-prettier": "^6.9.0", | ||
"eslint-plugin-prettier": "^3.1.2", | ||
"nodemon": "^2.0.2", | ||
"prettier": "^1.19.1", | ||
"typescript": "^3.7.4" | ||
"@typescript-eslint/eslint-plugin": "^3.0.2", | ||
"@typescript-eslint/parser": "^3.0.2", | ||
"ava": "^3.1.0", | ||
"eslint": "^7.1.0", | ||
"eslint-config-prettier": "^6.11.0", | ||
"eslint-plugin-prettier": "^3.1.3", | ||
"nodemon": "^2.0.4", | ||
"prettier": "^2.0.5", | ||
"typescript": "^3.9.3" | ||
}, | ||
@@ -40,0 +40,0 @@ "scripts": { |
@@ -1,2 +0,2 @@ | ||
[![Build status](https://travis-ci.org/mike-marcacci/fs-capacitor.svg?branch=master)](https://travis-ci.org/mike-marcacci/fs-capacitor) [![Current version](https://badgen.net/npm/v/fs-capacitor)](https://npm.im/fs-capacitor) ![Supported Node.js versions](https://badgen.net/npm/node/fs-capacitor) | ||
![Continuous Integration](https://github.com/mike-marcacci/fs-capacitor/workflows/Continuous%20Integration/badge.svg) [![Current Version](https://badgen.net/npm/v/fs-capacitor)](https://npm.im/fs-capacitor) ![Supported Node.js Versions](https://badgen.net/npm/node/fs-capacitor) | ||
@@ -3,0 +3,0 @@ # FS Capacitor |
20956
200