Skip to content

Commit

Permalink
fix(src/index.js): fix ObjectId recognize of different verison of bson
Browse files Browse the repository at this point in the history
  • Loading branch information
Goodluckhf committed Aug 26, 2018
1 parent f046ffe commit c3534c0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ export default class BunyanStdoutStream {
return this.config.colors.object.system('Function');
}

if (variable instanceof BSON.ObjectId) {
if (variable instanceof BSON.ObjectId || //eslint-disable-line no-mixed-operators
variable.constructor && variable.constructor.name.toLowerCase() === 'objectid' //eslint-disable-line no-mixed-operators
) {
const startSequence = this.config.colors.object.system('ObjectId("');
const endSequence = this.config.colors.object.system('")');

Expand Down

0 comments on commit c3534c0

Please sign in to comment.