!function(t, e) { "object" == typeof exports && "undefined" != typeof module ? e(exports, require("callable-instance2"), require("cross-spawn"), require("bluebird"), require("strip-ansi")) : "function" == typeof define && define.amd ? define([ "exports", "callable-instance2", "cross-spawn", "bluebird", "strip-ansi" ], e) : e((t = "undefined" != typeof globalThis ? globalThis : t || self).CrossSpawnExtra = {}, t.CallableInstance, t.CrossSpawn, t.Bluebird, t._stripAnsi); }(this, (function(t, e, r, s, n) { "use strict"; const i = /*#__PURE__*/ Symbol.for("cross-spawn"), o = /*#__PURE__*/ Symbol.for("bluebird"); class CrossSpawnExtra extends e { sync(...t) { let e = this[i].sync(...t); e.then = s.method((t => (delete e.then, t(e)))); let r = t[2]; return null != r && r.stripAnsi && (e.stderr = e.stderr && stripAnsi(e.stderr), e.stdout = e.stdout && stripAnsi(e.stdout)), e; } async(...t) { let e, r = { output: [], stdout: [], stderr: [] }, n = this[i], o = s.resolve(), u = t[2]; return e = n(...t), o.child = e, e.stderrStream = e.stderr, e.stdoutStream = e.stdout, o = o.thenReturn(new s((function(t, s) { function done(n) { let i = Buffer.concat(r.stderr), o = Buffer.concat(r.stdout); null != u && u.stripAnsi && (i = stripAnsi(i), o = stripAnsi(o)), e.stderr = i, e.stdout = o, e.output = [ null, o, i ], e._output = r.output, e.error && (e.error.child = e), e.error ? s(e.error) : t(e); } o.child = e, [ "stderr", "stdout" ].forEach((function(t) { e[t] && e[t].on("data", (function(e) { r[t].push(e), r.output.push(e); })); })), e.on("close", (function(...t) { e.status = t[0], done(); })), e.on("exit", (function(...t) { e.status = t[0], done(); })), e.on("error", (function(t) { e.error = t; })); })).tapCatch((t => { t && (t.child = e); }))), o.child = e, o; } spawnSync=this.sync; spawn=this.async; constructor(t, e) { super("async"), this[i] = t || r, this[o] = e || s, [ "core", "async", "sync" ].forEach((t => this[t] = this[t].bind(this))), Object.defineProperty(this, "__esModule", { value: !0 }); } static use(t, e) { return new this(t, e); } use(t, e) { return new CrossSpawnExtra(t, e); } core(...t) { return this[i](...t); } get coreSync() { return this[i].sync; } } function stripAnsi(t, e) { if (!t) return t; let r = Buffer.isBuffer(t); return t = t.toString(), t = n(t), r && !e ? Buffer.from(t) : t; } const u = /*#__PURE__*/ new CrossSpawnExtra, c = u.async = /*#__PURE__*/ u.async.bind(u), a = u.sync = /*#__PURE__*/ u.sync.bind(u); Object.defineProperty(u, "__esModule", { value: !0 }), Object.defineProperty(u, "crossSpawnExtra", { value: u }), Object.defineProperty(u, "default", { value: u }), Object.defineProperty(u, "SYM_CROSS_SPAWN", { value: i }), Object.defineProperty(u, "SYM_BLUEBIRD", { value: o }), Object.defineProperty(u, "stripAnsi", { value: stripAnsi }), t.CrossSpawnExtra = CrossSpawnExtra, t.SYM_BLUEBIRD = o, t.SYM_CROSS_SPAWN = i, t.async = c, t.crossSpawnExtra = u, t.default = u, t.stripAnsi = stripAnsi, t.sync = a, Object.defineProperty(t, "__esModule", { value: !0 }); })); //# sourceMappingURL=index.umd.production.min.cjs.map