Skip to content

Commit

Permalink
refactor(clean): extracted the assignment of loggerArgs[level]
Browse files Browse the repository at this point in the history
  • Loading branch information
CorentinTh committed Aug 28, 2024
1 parent aeaa077 commit 541bd2a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ export function createTestLogger() {
const loggerArgs: Record<string, unknown[]> = {};

const logFn = (level: string) => (...args: unknown[]) => {
(loggerArgs[level] ??= []).push(args);
if (!loggerArgs[level]) {
loggerArgs[level] = [];
}

loggerArgs[level].push(args);
};

const logger = {
Expand Down

0 comments on commit 541bd2a

Please sign in to comment.