You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
318 B
TypeScript
12 lines
318 B
TypeScript
import { ProcessOutput } from "zx/core";
|
|
|
|
export function printObject(
|
|
object: Record<string, unknown> | ProcessOutput,
|
|
method: "log" | "warn" | "error" = "log",
|
|
) {
|
|
for (const [key, value] of Object.entries(object)) {
|
|
// eslint-disable-next-line no-console
|
|
console[method](`${key}:\n${value}\n`);
|
|
}
|
|
}
|