Skip to content

Commit

Permalink
fix: attempt to fix browser mixin issue
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Jan 8, 2025
1 parent 7fb2a05 commit 6c6bef6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions helpers/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const silentSymbol = Symbol.for('axe.silent');
const connectionNameSymbol = Symbol.for('connection.name');

// wrapper for browser condition
const hasMixin = _ && _.mixin;
const hasMixin = mongoose && _ && _.mixin;

if (hasMixin) {
// <https://stackoverflow.com/a/41978063>
Expand Down Expand Up @@ -332,7 +332,7 @@ for (const level of logger.config.levels) {
// safeguard to redact sensitive fields
//
// wrapper for browser condition
if (hasMixin) {
if (mongoose && hasMixin) {
err = _.deeply(_.mapValues)(err, function (val, key) {
if (REDACTED_FIELDS.has(key)) {
return 'REDACTED';
Expand All @@ -344,7 +344,7 @@ for (const level of logger.config.levels) {

const hash = meta && meta.app && meta.app.hash;
// wrapper for browser condition
if (hasMixin) {
if (mongoose && hasMixin) {
meta = _.deeply(_.mapValues)(meta, function (val, key) {
if (REDACTED_FIELDS.has(key)) {
return 'REDACTED';
Expand Down

0 comments on commit 6c6bef6

Please sign in to comment.