diff options
author | guybedford <guybedford@gmail.com> | 2018-08-24 18:13:32 +0200 |
---|---|---|
committer | guybedford <guybedford@gmail.com> | 2018-09-04 16:08:21 +0200 |
commit | eef072fa083f05f84fa6ca1908472eb228095a38 (patch) | |
tree | 3fd3bc972b893bd49616bba2808e449743f55ee9 /lib/internal/fs/streams.js | |
parent | 0d3da39f575afba5ab6a5a34f4e88a798a66dc6d (diff) | |
download | android-node-v8-eef072fa083f05f84fa6ca1908472eb228095a38.tar.gz android-node-v8-eef072fa083f05f84fa6ca1908472eb228095a38.tar.bz2 android-node-v8-eef072fa083f05f84fa6ca1908472eb228095a38.zip |
url: provide pathToFileURL and fileURLToPath
PR-URL: https://github.com/nodejs/node/pull/22506
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Diffstat (limited to 'lib/internal/fs/streams.js')
-rw-r--r-- | lib/internal/fs/streams.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/internal/fs/streams.js b/lib/internal/fs/streams.js index 502b3c1430..a2ae1c9787 100644 --- a/lib/internal/fs/streams.js +++ b/lib/internal/fs/streams.js @@ -16,7 +16,7 @@ const { getOptions, } = require('internal/fs/utils'); const { Readable, Writable } = require('stream'); -const { getPathFromURL } = require('internal/url'); +const { toPathIfFileURL } = require('internal/url'); const util = require('util'); const kMinPoolSpace = 128; @@ -52,7 +52,7 @@ function ReadStream(path, options) { Readable.call(this, options); // path will be ignored when fd is specified, so it can be falsy - this.path = getPathFromURL(path); + this.path = toPathIfFileURL(path); this.fd = options.fd === undefined ? null : options.fd; this.flags = options.flags === undefined ? 'r' : options.flags; this.mode = options.mode === undefined ? 0o666 : options.mode; @@ -240,7 +240,7 @@ function WriteStream(path, options) { Writable.call(this, options); // path will be ignored when fd is specified, so it can be falsy - this.path = getPathFromURL(path); + this.path = toPathIfFileURL(path); this.fd = options.fd === undefined ? null : options.fd; this.flags = options.flags === undefined ? 'w' : options.flags; this.mode = options.mode === undefined ? 0o666 : options.mode; |