Skip to content

Commit

Permalink
better
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierZal committed May 19, 2024
1 parent 35e5f9e commit 84ea6f1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions decorators/addToLogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ export default <T extends new (...args: any[]) => SimpleClass>(
#commonLog(logType: 'error' | 'log', ...args: unknown[]): void {
super[logType](
...logs.flatMap((log) => {
let arg0: unknown = log
let arg: unknown = log
if (log in this) {
arg0 = this[log as keyof this]
arg = this[log as keyof this]
} else if (log.endsWith(PARENTHESES)) {
const funcName = log.slice(FIRST_CHAR, -PARENTHESES.length)
if (
Expand All @@ -32,11 +32,11 @@ export default <T extends new (...args: any[]) => SimpleClass>(
...funcArgs: unknown[]
) => unknown
if (!func.length) {
arg0 = func.call(this)
arg = func.call(this)
}
}
}
return [arg0, '-']
return [arg, '-']
}),
...args,
)
Expand Down

0 comments on commit 84ea6f1

Please sign in to comment.