mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
tty: refactor exports
This commit moves the tty module's exports to a single object, which is more aligned with other core modules. PR-URL: https://github.com/nodejs/node/pull/16959 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
1 parent
af579907de
commit
5ee05f2187
1 file changed
+5
-5
+5
-5
@@ -29,9 +29,9 @@ const errnoException = util._errnoException;
|
||||
const errors = require('internal/errors');
|
||||
const readline = require('readline');
|
||||
|
||||
exports.isatty = function(fd) {
|
||||
function isatty(fd) {
|
||||
return Number.isInteger(fd) && fd >= 0 && isTTY(fd);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
function ReadStream(fd, options) {
|
||||
@@ -54,8 +54,6 @@ function ReadStream(fd, options) {
|
||||
}
|
||||
inherits(ReadStream, net.Socket);
|
||||
|
||||
exports.ReadStream = ReadStream;
|
||||
|
||||
ReadStream.prototype.setRawMode = function(flag) {
|
||||
flag = !!flag;
|
||||
this._handle.setRawMode(flag);
|
||||
@@ -90,7 +88,6 @@ function WriteStream(fd) {
|
||||
}
|
||||
}
|
||||
inherits(WriteStream, net.Socket);
|
||||
exports.WriteStream = WriteStream;
|
||||
|
||||
|
||||
WriteStream.prototype.isTTY = true;
|
||||
@@ -131,3 +128,6 @@ WriteStream.prototype.clearScreenDown = function() {
|
||||
WriteStream.prototype.getWindowSize = function() {
|
||||
return [this.columns, this.rows];
|
||||
};
|
||||
|
||||
|
||||
module.exports = { isatty, ReadStream, WriteStream };
|
||||
Reference in new issue
Block a user