perf: speed up memory batch polling
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { clearActiveProgressLine } from "./terminal/progress-line.js";
|
||||
|
||||
export type RuntimeEnv = {
|
||||
log: typeof console.log;
|
||||
error: typeof console.error;
|
||||
@@ -5,8 +7,14 @@ export type RuntimeEnv = {
|
||||
};
|
||||
|
||||
export const defaultRuntime: RuntimeEnv = {
|
||||
log: console.log,
|
||||
error: console.error,
|
||||
log: (...args: Parameters<typeof console.log>) => {
|
||||
clearActiveProgressLine();
|
||||
console.log(...args);
|
||||
},
|
||||
error: (...args: Parameters<typeof console.error>) => {
|
||||
clearActiveProgressLine();
|
||||
console.error(...args);
|
||||
},
|
||||
exit: (code) => {
|
||||
process.exit(code);
|
||||
throw new Error("unreachable"); // satisfies tests when mocked
|
||||
|
||||
Reference in New Issue
Block a user