Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
fix(sdam): we can't use Array.includes yet
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed May 23, 2018
1 parent 91df350 commit 9c3b5ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/sdam/server_description.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ class ServerDescription {
* @return {Boolean} Is this server available for writes
*/
get isWritable() {
return [ServerType.RSPrimary, ServerType.Standalone, ServerType.Mongos].includes(this.type);
return (
[ServerType.RSPrimary, ServerType.Standalone, ServerType.Mongos].indexOf(this.type) !== -1
);
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/uri_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function parseSrvConnectionString(uri, options, callback) {

record = record[0];
record = record.length > 1 ? record.join('') : record[0];
if (!record.includes('authSource') && !record.includes('replicaSet')) {
if (record.indexOf('authSource') === -1 && record.indexOf('replicaSet') === -1) {
return callback(
new MongoParseError('Text record must only set `authSource` or `replicaSet`')
);
Expand Down

0 comments on commit 9c3b5ab

Please sign in to comment.