Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implement rows/columns as getter property

  • Loading branch information...
commit fb0d608403bca8a952581be69027d59baf326048 1 parent 036df8a
isaacs authored
Showing with 15 additions and 4 deletions.
  1. +15 −4 mute.js
19 mute.js
View
@@ -63,12 +63,23 @@ function setIsTTY (isTTY) {
})
}
+Object.defineProperty(MuteStream.prototype, 'rows', {
+ get: function () {
+ return( this._dest ? this._dest.rows
+ : this._src ? this._src.rows
+ : undefined )
+ }, enumerable: true, configurable: true })
+
+Object.defineProperty(MuteStream.prototype, 'columns', {
+ get: function () {
+ return( this._dest ? this._dest.columns
+ : this._src ? this._src.columns
+ : undefined )
+ }, enumerable: true, configurable: true })
+
+
MuteStream.prototype.pipe = function (dest) {
this._dest = dest
- if(this._dest.isTTY){
- this.columns = dest.columns
- this.rows = dest.rows
- }
return Stream.prototype.pipe.call(this, dest)
}
Please sign in to comment.
Something went wrong with that request. Please try again.