diff options
author | rickyes <mail@zhoumq.cn> | 2020-05-08 05:26:37 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2020-05-20 13:34:54 +0300 |
commit | 1a12b82396c6c0747f8f5c96a28d019f774e0257 (patch) | |
tree | a2c06167e23a9e94caea2d4a830af44c0d6ca788 /lib/internal/fs | |
parent | 08308c7111b8accc77092999ad4c8fb63807c1f4 (diff) |
fs: refactor the import of internalUtil
PR-URL: https://github.com/nodejs/node/pull/33296
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Diffstat (limited to 'lib/internal/fs')
-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 2466432cb03..343e577049d 100644 --- a/lib/internal/fs/streams.js +++ b/lib/internal/fs/streams.js @@ -15,7 +15,7 @@ const { ERR_OUT_OF_RANGE, ERR_STREAM_DESTROYED } = require('internal/errors').codes; -const internalUtil = require('internal/util'); +const { deprecate } = require('internal/util'); const { validateNumber } = require('internal/validators'); const fs = require('fs'); const { Buffer } = require('buffer'); @@ -142,7 +142,7 @@ function ReadStream(path, options) { ObjectSetPrototypeOf(ReadStream.prototype, Readable.prototype); ObjectSetPrototypeOf(ReadStream, Readable); -const openReadFs = internalUtil.deprecate(function() { +const openReadFs = deprecate(function() { _openReadFs(this); }, 'ReadStream.prototype.open() is deprecated', 'DEP0135'); ReadStream.prototype.open = openReadFs; @@ -370,7 +370,7 @@ WriteStream.prototype._final = function(callback) { callback(); }; -const openWriteFs = internalUtil.deprecate(function() { +const openWriteFs = deprecate(function() { _openWriteFs(this); }, 'WriteStream.prototype.open() is deprecated', 'DEP0135'); WriteStream.prototype.open = openWriteFs; |