Skip to content

Commit

Permalink
fix: allow Uint8Arrays to be passed to FsWriteStream (#842)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMYHuang committed May 28, 2022
1 parent 0587738 commit 4398992
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/volume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2567,7 +2567,7 @@ FsWriteStream.prototype.open = function() {
};

FsWriteStream.prototype._write = function(data, encoding, cb) {
if (!(data instanceof Buffer)) return this.emit('error', new Error('Invalid data'));
if (!(data instanceof Buffer || data instanceof Uint8Array)) return this.emit('error', new Error('Invalid data'));

if (typeof this.fd !== 'number') {
return this.once('open', function() {
Expand Down

0 comments on commit 4398992

Please sign in to comment.