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;