Skip to content

Commit

Permalink
fs: refactor deprecated functions for readability
Browse files Browse the repository at this point in the history
This is a small refactor to make an object more readable (IMO).

Yeah, I spent a bit longer looking at the code and misunderstanding it
than I care to admit right now.

PR-URL: #12910
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Trott committed May 11, 2017
1 parent c79deaa commit 6f449db
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/fs.js
Expand Up @@ -2140,10 +2140,8 @@ WriteStream.prototype.destroySoon = WriteStream.prototype.end;
var SyncWriteStream = internalFS.SyncWriteStream;
Object.defineProperty(fs, 'SyncWriteStream', {
configurable: true,
get: internalUtil.deprecate(() => {
return SyncWriteStream;
}, 'fs.SyncWriteStream is deprecated.', 'DEP0061'),
set: internalUtil.deprecate((val) => {
SyncWriteStream = val;
}, 'fs.SyncWriteStream is deprecated.', 'DEP0061')
get: internalUtil.deprecate(() => SyncWriteStream,
'fs.SyncWriteStream is deprecated.', 'DEP0061'),
set: internalUtil.deprecate((val) => { SyncWriteStream = val; },
'fs.SyncWriteStream is deprecated.', 'DEP0061')
});

0 comments on commit 6f449db

Please sign in to comment.