Skip to content

Commit

Permalink
test: fix tests re: Automattic/mongoose#6880
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Aug 22, 2018
1 parent 59d59f1 commit 06e8aa7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/utils.js
Expand Up @@ -29,10 +29,8 @@ var clone = exports.clone = function clone(obj, options) {
: new obj.constructor(obj.id);
}

if ('ReadPreference' === obj._type && obj.isValid && obj.toObject) {
return 'function' == typeof obj.clone
? obj.clone()
: new obj.constructor(obj.mode, clone(obj.tags, options));
if (obj.constructor.name === 'ReadPreference') {
return new obj.constructor(obj.mode, clone(obj.tags, options));
}

if ('Binary' == obj._bsontype && obj.buffer && obj.value) {
Expand Down

0 comments on commit 06e8aa7

Please sign in to comment.