Refactoring day1
This commit is contained in:
10
node_modules/mongodb/lib/write_concern.js
generated
vendored
10
node_modules/mongodb/lib/write_concern.js
generated
vendored
@@ -1,7 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
const kWriteConcernKeys = new Set(['w', 'wtimeout', 'j', 'fsync']);
|
||||
|
||||
/**
|
||||
* The **WriteConcern** class is a class that represents a MongoDB WriteConcern.
|
||||
* @class
|
||||
@@ -53,14 +51,6 @@ class WriteConcern {
|
||||
}
|
||||
|
||||
if (options.writeConcern) {
|
||||
if (typeof options.writeConcern === 'string') {
|
||||
return new WriteConcern(options.writeConcern);
|
||||
}
|
||||
|
||||
if (!Object.keys(options.writeConcern).some(key => kWriteConcernKeys.has(key))) {
|
||||
return;
|
||||
}
|
||||
|
||||
return new WriteConcern(
|
||||
options.writeConcern.w,
|
||||
options.writeConcern.wtimeout,
|
||||
|
||||
Reference in New Issue
Block a user