Skip to content

Commit

Permalink
chore: define context as singular var, passed to fns
Browse files Browse the repository at this point in the history
  • Loading branch information
vernak2539 committed Apr 4, 2024
1 parent ffc5513 commit 299a1f9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,18 @@ const init = ({

const captureMessage = (format, ...args) => {
const message = util.format(format, ...args)
const context = { group: groups[groups.length - 1], groups }

if (
typeof silenceMessage === 'function' &&
silenceMessage(message, methodName, { group: groups[groups.length - 1], groups })
silenceMessage(message, methodName, context)
) {
return
}

if (
typeof allowMessage === 'function' &&
allowMessage(message, methodName, { group: groups[groups.length - 1], groups })
allowMessage(message, methodName, context)
) {
originalMethod(format, ...args)
return
Expand Down

0 comments on commit 299a1f9

Please sign in to comment.