XuqmGroup-H5SDK/node_modules/@rushstack/terminal/lib-esm/MockWritable.js
徐勤民 e34fa2052a feat(private): add private deployment SDK module
Adds @xuqm/h5-sdk/private entry point with JSON-based initialization,
feature gating, and error codes for private deployment scenarios.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 21:08:08 +08:00

28 行
861 B
JavaScript

// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
import { AnsiEscape } from './AnsiEscape';
import { TerminalWritable } from './TerminalWritable';
/**
* A {@link TerminalWritable} subclass for use by unit tests.
*
* @beta
*/
export class MockWritable extends TerminalWritable {
constructor() {
super(...arguments);
this.chunks = [];
}
onWriteChunk(chunk) {
this.chunks.push(chunk);
}
reset() {
this.chunks.length = 0;
}
getAllOutput() {
return AnsiEscape.formatForTests(this.chunks.map((x) => x.text).join(''));
}
getFormattedChunks() {
return this.chunks.map((x) => ({ ...x, text: AnsiEscape.formatForTests(x.text) }));
}
}
//# sourceMappingURL=MockWritable.js.map