@@ -16,7 +16,7 @@ const createSSHTunnel = require('./ssh-tunnel');
1616
1717const debug = require ( 'debug' ) ( 'mongodb-connection-model:connect' ) ;
1818
19- const needToLoadSSLFiles = model =>
19+ const needToLoadSSLFiles = ( model ) =>
2020 ! includes ( [ 'NONE' , 'UNVALIDATED' ] , model . sslType ) ;
2121
2222const loadOptions = ( model , done ) => {
@@ -29,17 +29,17 @@ const loadOptions = (model, done) => {
2929 const tasks = { } ;
3030 const opts = clone ( model . driverOptions , true ) ;
3131
32- Object . keys ( opts ) . map ( key => {
32+ Object . keys ( opts ) . map ( ( key ) => {
3333 if ( key . indexOf ( 'ssl' ) === - 1 ) {
3434 return ;
3535 }
3636
3737 if ( Array . isArray ( opts [ key ] ) ) {
38- opts [ key ] . forEach ( value => {
38+ opts [ key ] . forEach ( ( value ) => {
3939 if ( typeof value === 'string' ) {
40- tasks [ key ] = cb =>
40+ tasks [ key ] = ( cb ) =>
4141 async . parallel (
42- opts [ key ] . map ( k => fs . readFile . bind ( null , k ) ) ,
42+ opts [ key ] . map ( ( k ) => fs . readFile . bind ( null , k ) ) ,
4343 cb
4444 ) ;
4545 }
@@ -62,7 +62,7 @@ const loadOptions = (model, done) => {
6262 return done ( err ) ;
6363 }
6464
65- Object . keys ( res ) . map ( key => {
65+ Object . keys ( res ) . map ( ( key ) => {
6666 opts [ key ] = res [ key ] ;
6767 } ) ;
6868
@@ -92,7 +92,7 @@ const validateURL = (model, done) => {
9292 } ) ;
9393} ;
9494
95- const getStatusStateString = evt => {
95+ const getStatusStateString = ( evt ) => {
9696 if ( ! evt ) {
9797 return 'UNKNOWN' ;
9898 }
@@ -147,7 +147,7 @@ const getTasks = (model, setupListeners) => {
147147 }
148148 } ;
149149
150- ctx . skip = reason => {
150+ ctx . skip = ( reason ) => {
151151 state . emit ( 'status' , { message, skipped : true , reason } ) ;
152152
153153 if ( cb ) {
@@ -169,7 +169,7 @@ const getTasks = (model, setupListeners) => {
169169 * TODO (imlucas) dns.lookup() model.hostname and model.sshTunnelHostname to check for typos
170170 */
171171 assign ( tasks , {
172- 'Load SSL files' : cb => {
172+ 'Load SSL files' : ( cb ) => {
173173 const ctx = status ( 'Load SSL files' , cb ) ;
174174
175175 if ( ! needToLoadSSLFiles ( model ) ) {
@@ -183,7 +183,7 @@ const getTasks = (model, setupListeners) => {
183183 } ) ;
184184
185185 assign ( tasks , {
186- 'Create SSH Tunnel' : cb => {
186+ 'Create SSH Tunnel' : ( cb ) => {
187187 const ctx = status ( 'Create SSH Tunnel' , cb ) ;
188188
189189 if ( model . sshTunnel === 'NONE' ) {
@@ -195,7 +195,7 @@ const getTasks = (model, setupListeners) => {
195195 } ) ;
196196
197197 assign ( tasks , {
198- 'Connect to MongoDB' : cb => {
198+ 'Connect to MongoDB' : ( cb ) => {
199199 const ctx = status ( 'Connect to MongoDB' ) ;
200200
201201 // @note : Durran:
@@ -285,7 +285,7 @@ const connect = (model, setupListeners, done) => {
285285 }
286286
287287 if ( ! isFunction ( done ) ) {
288- done = err => {
288+ done = ( err ) => {
289289 if ( err ) {
290290 throw err ;
291291 }
@@ -297,13 +297,13 @@ const connect = (model, setupListeners, done) => {
297297 'mongodb-connection-model:connect:status'
298298 ) ;
299299
300- tasks . state . on ( 'status' , evt => {
300+ tasks . state . on ( 'status' , ( evt ) => {
301301 logTaskStatus ( '%s [%s]' , evt . message , getStatusStateString ( evt ) ) ;
302302 } ) ;
303303
304304 logTaskStatus ( 'Connecting...' ) ;
305305
306- async . series ( tasks , err => {
306+ async . series ( tasks , ( err ) => {
307307 if ( err ) {
308308 logTaskStatus ( 'Error connecting:' , err ) ;
309309
0 commit comments