Skip to content

Commit

Permalink
Fix ObjectID serialization issue
Browse files Browse the repository at this point in the history
See issue #85
  • Loading branch information
j13z committed Jan 3, 2017
1 parent 0934814 commit 7a4faff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/helpers.js
Expand Up @@ -6,6 +6,7 @@
*/
'use strict';
const common = require('winston/lib/winston/common');
const ObjectID = require('mongodb').ObjectID;


/**
Expand Down Expand Up @@ -64,7 +65,7 @@ function makeObjectNonCircular(node, opt_parents) {
continue;
}
let value = node[key];
if (typeof value === 'object') {
if (typeof value === 'object' && !(value instanceof ObjectID)) {
if (opt_parents.indexOf(value) === -1) {
copy[key] = makeObjectNonCircular(value, opt_parents);
} else {
Expand Down

0 comments on commit 7a4faff

Please sign in to comment.