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

Commit 9c3b5ab

Browse files
committed
fix(sdam): we can't use Array.includes yet
1 parent 91df350 commit 9c3b5ab

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/sdam/server_description.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ class ServerDescription {
6666
* @return {Boolean} Is this server available for writes
6767
*/
6868
get isWritable() {
69-
return [ServerType.RSPrimary, ServerType.Standalone, ServerType.Mongos].includes(this.type);
69+
return (
70+
[ServerType.RSPrimary, ServerType.Standalone, ServerType.Mongos].indexOf(this.type) !== -1
71+
);
7072
}
7173
}
7274

lib/uri_parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function parseSrvConnectionString(uri, options, callback) {
109109

110110
record = record[0];
111111
record = record.length > 1 ? record.join('') : record[0];
112-
if (!record.includes('authSource') && !record.includes('replicaSet')) {
112+
if (record.indexOf('authSource') === -1 && record.indexOf('replicaSet') === -1) {
113113
return callback(
114114
new MongoParseError('Text record must only set `authSource` or `replicaSet`')
115115
);

0 commit comments

Comments
 (0)