withLoggedMethodCalls: less noisy output

This commit is contained in:
MapleLeaf
2021-12-25 00:52:08 -06:00
parent 59bce88f3a
commit fa95b42be6

View File

@@ -11,7 +11,11 @@ export function withLoggedMethodCalls<T extends object>(value: T) {
return (...values: any[]) => {
console.info(
`${String(property)}(${values
.map((value) => inspect(value, { depth: 1 }))
.map((value) =>
typeof value === "object" && value !== null
? value.constructor.name
: inspect(value, { colors: true }),
)
.join(", ")})`,
)
return value.apply(target, values)