remove backward compat tty helpers.

This commit is contained in:
Christopher Jeffrey 2015-07-31 00:09:46 -07:00
parent b4fb673943
commit af2a42423b
1 changed files with 0 additions and 38 deletions

View File

@ -156,41 +156,3 @@ helpers.__defineGetter__('Element', function() {
} }
return helpers._element; return helpers._element;
}); });
helpers.isTTY = function(stream) {
if (stream.isTTY) {
return true;
}
if (stream.fd != null) {
return require('tty').isatty(stream.fd);
}
return false;
};
helpers.hasRaw = function(stream, value) {
return !!stream.setRawMode
|| (stream === process.stdin)
|| !!(stream._handle && stream._handle.setRawMode && stream.readable);
};
helpers.setRawMode = function(stream, value) {
if (stream.setRawMode) {
return stream.setRawMode(value);
}
if (stream === process.stdin) {
stream._blessedRaw = value;
return require('tty').setRawMode(value);
}
if (stream._handle && stream._handle.setRawMode && stream.readable) {
stream._blessedRaw = value;
return stream._handle.setRawMode(value);
}
throw new Error('Could not set raw mode.');
};
helpers.isRaw = function(stream) {
if (stream.isRaw != null) {
return stream.isRaw;
}
return !!stream._blessedRaw;
};