Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Implement rows/columns as getter property

  • Loading branch information...
commit fb0d608403bca8a952581be69027d59baf326048 1 parent 036df8a
Isaac Z. Schlueter authored

Showing 1 changed file with 15 additions and 4 deletions. Show diff stats Hide diff stats

  1. +15 4 mute.js
19 mute.js
@@ -63,12 +63,23 @@ function setIsTTY (isTTY) {
63 63 })
64 64 }
65 65
  66 +Object.defineProperty(MuteStream.prototype, 'rows', {
  67 + get: function () {
  68 + return( this._dest ? this._dest.rows
  69 + : this._src ? this._src.rows
  70 + : undefined )
  71 + }, enumerable: true, configurable: true })
  72 +
  73 +Object.defineProperty(MuteStream.prototype, 'columns', {
  74 + get: function () {
  75 + return( this._dest ? this._dest.columns
  76 + : this._src ? this._src.columns
  77 + : undefined )
  78 + }, enumerable: true, configurable: true })
  79 +
  80 +
66 81 MuteStream.prototype.pipe = function (dest) {
67 82 this._dest = dest
68   - if(this._dest.isTTY){
69   - this.columns = dest.columns
70   - this.rows = dest.rows
71   - }
72 83 return Stream.prototype.pipe.call(this, dest)
73 84 }
74 85

0 comments on commit fb0d608

Please sign in to comment.
Something went wrong with that request. Please try again.