@moonwall/cli
Version:
Testing framework for the Moon family of projects
26 lines • 1.12 kB
JavaScript
const originalWrite = process.stderr.write.bind(process.stderr);
const blockList = [
"has multiple versions, ensure that there is only one installed",
"Unable to map [u8; 32] to a lookup index",
];
process.stderr.write = (chunk, encodingOrCallback, callback) => {
let shouldWrite = true;
if (typeof chunk === "string") {
shouldWrite = !blockList.some((phrase) => chunk.includes(phrase));
}
if (shouldWrite) {
if (typeof encodingOrCallback === "function") {
// Second argument must always be BufferEncoding or undefined.
// When encodingOrCallback is a function, pass as cb; encoding is undefined.
return originalWrite.call(process.stderr, chunk, undefined, encodingOrCallback);
}
return originalWrite.call(process.stderr, chunk, encodingOrCallback, callback);
}
// Suppress output but invoke callback if present
const cb = typeof encodingOrCallback === "function" ? encodingOrCallback : callback;
if (cb)
cb(null);
return true;
};
export default function () { }
//# sourceMappingURL=logging.js.map