From a90b96f338498b23e2b5bcc6db7b7ad08b8a660c Mon Sep 17 00:00:00 2001 From: rickyes Date: Fri, 8 May 2020 10:26:37 +0800 Subject: [PATCH] fs: refactor the import of internalUtil PR-URL: https://github.com/nodejs/node/pull/33296 Reviewed-By: Anna Henningsen Reviewed-By: Joyee Cheung Reviewed-By: Zeyu Yang --- lib/internal/fs/streams.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/internal/fs/streams.js b/lib/internal/fs/streams.js index 2466432cb03e54..343e577049d9b2 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;