MCPcopy
hub / github.com/BrainJS/brain.js / destroy

Function destroy

browser.min.js:413–413  ·  view source on GitHub ↗
(t,e)

Source from the content-addressed store, hash-verified

411
412},{"safe-buffer":107,"util":49}],100:[function(require,module,exports){
413"use strict";function destroy(t,e){var r=this,a=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return a||i?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||pna.nextTick(emitErrorNT,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(pna.nextTick(emitErrorNT,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)}),this)}function undestroy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function emitErrorNT(t,e){t.emit("error",e)}var pna=require("process-nextick-args");module.exports={destroy:destroy,undestroy:undestroy};
414
415},{"process-nextick-args":91}],101:[function(require,module,exports){
416module.exports=require("events").EventEmitter;

Callers

nothing calls this directly

Calls 1

eFunction · 0.85

Tested by

no test coverage detected