bare-tty 2.1.2 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +7 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -130,7 +130,14 @@ exports.WriteStream = class TTYWriteStream extends Writable {
130
130
  binding.end(this._handle)
131
131
  }
132
132
 
133
+ _predestroy () {
134
+ if (this._handle === null) return
135
+ binding.close(this._handle)
136
+ TTYWriteStream._streams.delete(this)
137
+ }
138
+
133
139
  _destroy (cb) {
140
+ if (this._handle === null) return cb(null)
134
141
  this._pendingDestroy = cb
135
142
  binding.close(this._handle)
136
143
  TTYWriteStream._streams.delete(this)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-tty",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "description": "Native TTY streams for JavaScript",
5
5
  "main": "index.js",
6
6
  "files": [