ScuttleBot

scuttlebot / tests / e2e / node_modules / playwright / lib / mcp / test / streams.js
Source Blame History 44 lines
f7eb47b… lmata 1 "use strict";
f7eb47b… lmata 2 var __defProp = Object.defineProperty;
f7eb47b… lmata 3 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
f7eb47b… lmata 4 var __getOwnPropNames = Object.getOwnPropertyNames;
f7eb47b… lmata 5 var __hasOwnProp = Object.prototype.hasOwnProperty;
f7eb47b… lmata 6 var __export = (target, all) => {
f7eb47b… lmata 7 for (var name in all)
f7eb47b… lmata 8 __defProp(target, name, { get: all[name], enumerable: true });
f7eb47b… lmata 9 };
f7eb47b… lmata 10 var __copyProps = (to, from, except, desc) => {
f7eb47b… lmata 11 if (from && typeof from === "object" || typeof from === "function") {
f7eb47b… lmata 12 for (let key of __getOwnPropNames(from))
f7eb47b… lmata 13 if (!__hasOwnProp.call(to, key) && key !== except)
f7eb47b… lmata 14 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
f7eb47b… lmata 15 }
f7eb47b… lmata 16 return to;
f7eb47b… lmata 17 };
f7eb47b… lmata 18 var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
f7eb47b… lmata 19 var streams_exports = {};
f7eb47b… lmata 20 __export(streams_exports, {
f7eb47b… lmata 21 StringWriteStream: () => StringWriteStream
f7eb47b… lmata 22 });
f7eb47b… lmata 23 module.exports = __toCommonJS(streams_exports);
f7eb47b… lmata 24 var import_stream = require("stream");
f7eb47b… lmata 25 var import_util = require("../../util");
f7eb47b… lmata 26 class StringWriteStream extends import_stream.Writable {
f7eb47b… lmata 27 constructor(output, stdio) {
f7eb47b… lmata 28 super();
f7eb47b… lmata 29 this._output = output;
f7eb47b… lmata 30 this._prefix = stdio === "stdout" ? "" : "[err] ";
f7eb47b… lmata 31 }
f7eb47b… lmata 32 _write(chunk, encoding, callback) {
f7eb47b… lmata 33 let text = (0, import_util.stripAnsiEscapes)(chunk.toString());
f7eb47b… lmata 34 if (text.endsWith("\n"))
f7eb47b… lmata 35 text = text.slice(0, -1);
f7eb47b… lmata 36 if (text)
f7eb47b… lmata 37 this._output.push(this._prefix + text);
f7eb47b… lmata 38 callback();
f7eb47b… lmata 39 }
f7eb47b… lmata 40 }
f7eb47b… lmata 41 // Annotate the CommonJS export names for ESM import in node:
f7eb47b… lmata 42 0 && (module.exports = {
f7eb47b… lmata 43 StringWriteStream
f7eb47b… lmata 44 });

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button