Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
var bson = require('bson');
var pure = {};
pure.Long = bson.pure().Long;
pure.doc = { long: pure.Long.fromNumber(100) };
pure.BSON = bson.pure().BSON;
pure.obj = new (pure.BSON)();
pure.data = pure.obj.serialize(pure.doc, false, true, false);
pure.doc2 = pure.obj.deserialize(pure.data);
var natv = {};
natv.Long = bson.native().Long;
natv.doc = { long: natv.Long.fromNumber(200) };
natv.BSON = bson.native().BSON;
natv.obj = new (natv.BSON)();
natv.data = natv.obj.serialize(natv.doc, false, true, false);
natv.doc2 = natv.obj.deserialize(natv.data);
if (pure.doc2.long === 100) {
if (natv.doc2.long === 200) {
console.log('ok');
}
'use strict';
var bson = require('bson');
var pure = {};
pure.Long = bson.pure().Long;
pure.doc = { long: pure.Long.fromNumber(100) };
pure.BSON = bson.pure().BSON;
pure.obj = new (pure.BSON)();
pure.data = pure.obj.serialize(pure.doc, false, true, false);
pure.doc2 = pure.obj.deserialize(pure.data);
var natv = {};
natv.Long = bson.native().Long;
natv.doc = { long: natv.Long.fromNumber(200) };
natv.BSON = bson.native().BSON;
natv.obj = new (natv.BSON)();
natv.data = natv.obj.serialize(natv.doc, false, true, false);
natv.doc2 = natv.obj.deserialize(natv.data);
if (pure.doc2.long === 100) {
if (natv.doc2.long === 200) {
ReplSet.prototype.setBSONParserType = function(type) {
var nBSON = null;
if(type == 'c++') {
nBSON = require('bson').native().BSON;
} else if(type == 'js') {
nBSON = require('bson').pure().BSON;
} else {
throw new MongoError(f("% parser not supported", type));
}
this.s.options.bson = new nBSON(bsonTypes);
}
Mongos.prototype.setBSONParserType = function(type) {
var nBSON = null;
if(type == 'c++') {
nBSON = require('bson').native().BSON;
} else if(type == 'js') {
nBSON = require('bson').pure().BSON;
} else {
throw new MongoError(f("% parser not supported", type));
}
this.s.options.bson = new nBSON(bsonTypes);
}
Server.prototype.setBSONParserType = function(type) {
var nBSON = null;
if(type == 'c++') {
nBSON = require('bson').native().BSON;
} else if(type == 'js') {
nBSON = require('bson').pure().BSON;
} else {
throw new MongoError(f("% parser not supported", type));
}
this.s.options.bson = new nBSON(bsonTypes);
}
Server.prototype.setBSONParserType = function(type) {
var nBSON = null;
if(type == 'c++') {
nBSON = require('bson').native().BSON;
} else if(type == 'js') {
nBSON = require('bson').pure().BSON;
} else {
throw new MongoError(f("% parser not supported", type));
}
this.s.options.bson = new nBSON(bsonTypes);
}
ReplSet.prototype.setBSONParserType = function(type) {
var nBSON = null;
if(type == 'c++') {
nBSON = require('bson').native().BSON;
} else if(type == 'js') {
nBSON = require('bson').pure().BSON;
} else {
throw new MongoError(f("% parser not supported", type));
}
this.s.options.bson = new nBSON(bsonTypes);
}
Server.prototype.setBSONParserType = function(type) {
var nBSON = null;
if(type == 'c++') {
nBSON = require('bson').native().BSON;
} else if(type == 'js') {
nBSON = require('bson').pure().BSON;
} else {
throw new MongoError(f("% parser not supported", type));
}
this.s.options.bson = new nBSON(bsonTypes);
}
var fs = require('fs');
var util = require('util');
var path = require('path');
var async = require('async');
var streams = require('stream-wrapper');
var parallel = require('parallel-transform');
var speedometer = require('speedometer');
var stringify = require('json-stable-stringify');
var bson = new (require('bson').pure().BSON)();
var mongojs = require('mongojs');
var traverse = require('traverse');
var diff = require('./diff');
var DEFAULT_CONCURRENCY = 1;
var ATTEMPT_LIMIT = 5;
var JSON_STRINGIFY_SOURCE = fs.readFileSync(require.resolve('json-stable-stringify'), 'utf-8');
var COMPARE_TEMPLATE = fs.readFileSync(path.join(__dirname, 'compare.js.txt'), 'utf-8');
var bsonCopy = function(obj) {
return bson.deserialize(bson.serialize(obj));
};
var extend = function(dest, src) {
Mongos.prototype.setBSONParserType = function(type) {
var nBSON = null;
if(type == 'c++') {
nBSON = require('bson').native().BSON;
} else if(type == 'js') {
nBSON = require('bson').pure().BSON;
} else {
throw new MongoError(f("% parser not supported", type));
}
this.s.options.bson = new nBSON(bsonTypes);
}