@sap/generator-fiori
Version:
Create an SAPUI5 application using SAP Fiori elements or a freestyle approach
3 lines (2 loc) • 2.45 kB
JavaScript
const __esmImportMetaUrl = require('node:url').pathToFileURL(__filename).href;
var n=Object.defineProperty;var i=(t,r)=>n(t,"name",{value:r,configurable:!0});var o=require("stream");module.exports=e;function e(t){o.apply(this),t=t||{},this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=t.replace,this._prompt=t.prompt||null,this._hadControl=!1}i(e,"MuteStream");e.prototype=Object.create(o.prototype);Object.defineProperty(e.prototype,"constructor",{value:e,enumerable:!1});e.prototype.mute=function(){this.muted=!0};e.prototype.unmute=function(){this.muted=!1};Object.defineProperty(e.prototype,"_onpipe",{value:u,enumerable:!1,writable:!0,configurable:!0});function u(t){this._src=t}i(u,"onPipe");Object.defineProperty(e.prototype,"isTTY",{get:a,set:h,enumerable:!0,configurable:!0});function a(){return this._dest?this._dest.isTTY:this._src?this._src.isTTY:!1}i(a,"getIsTTY");function h(t){Object.defineProperty(this,"isTTY",{value:t,enumerable:!0,writable:!0,configurable:!0})}i(h,"setIsTTY");Object.defineProperty(e.prototype,"rows",{get:i(function(){return this._dest?this._dest.rows:this._src?this._src.rows:void 0},"get"),enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"columns",{get:i(function(){return this._dest?this._dest.columns:this._src?this._src.columns:void 0},"get"),enumerable:!0,configurable:!0});e.prototype.pipe=function(t,r){return this._dest=t,o.prototype.pipe.call(this,t,r)};e.prototype.pause=function(){if(this._src)return this._src.pause()};e.prototype.resume=function(){if(this._src)return this._src.resume()};e.prototype.write=function(t){if(this.muted){if(!this.replace)return!0;if(t.match(/^\u001b/))return t.indexOf(this._prompt)===0&&(t=t.substr(this._prompt.length),t=t.replace(/./g,this.replace),t=this._prompt+t),this._hadControl=!0,this.emit("data",t);this._prompt&&this._hadControl&&t.indexOf(this._prompt)===0&&(this._hadControl=!1,this.emit("data",this._prompt),t=t.substr(this._prompt.length)),t=t.toString().replace(/./g,this.replace)}this.emit("data",t)};e.prototype.end=function(t){this.muted&&(t&&this.replace?t=t.toString().replace(/./g,this.replace):t=null),t&&this.emit("data",t),this.emit("end")};function p(t){return function(){var r=this._dest,s=this._src;r&&r[t]&&r[t].apply(r,arguments),s&&s[t]&&s[t].apply(s,arguments)}}i(p,"proxy");e.prototype.destroy=p("destroy");e.prototype.destroySoon=p("destroySoon");e.prototype.close=p("close");