Skip to content

Commit ed8b083

Browse files
aduh95RaisinTen
andauthored
Apply suggestions from code review
Co-authored-by: Darshan Sen <raisinten@gmail.com>
1 parent 14e8a18 commit ed8b083

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/internal/fs/streams.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const { Buffer } = require('buffer');
2020
const {
2121
copyObject,
2222
getOptions,
23-
validatePath
23+
validatePath,
2424
} = require('internal/fs/utils');
2525
const { Readable, Writable, finished } = require('stream');
2626
const { toPathIfFileURL } = require('internal/url');
@@ -134,7 +134,7 @@ function ReadStream(path, options) {
134134

135135
// If fd has been set, validate, otherwise validate path.
136136
if (this.fd != null) {
137-
validateInteger(this.fd, 'fd', 0);
137+
this.fd = getValidatedFd(this.fd);
138138
} else {
139139
validatePath(this.path);
140140
}
@@ -306,7 +306,7 @@ function WriteStream(path, options) {
306306

307307
// If fd has been set, validate, otherwise validate path.
308308
if (this.fd != null) {
309-
validateInteger(this.fd, 'fd', 0);
309+
this.fd = getValidatedFd(this.fd);
310310
} else {
311311
validatePath(this.path);
312312
}

0 commit comments

Comments
 (0)