@@ -149,7 +149,7 @@ export default class Client {
149149 */
150150 openConnection ( ) {
151151 return new Promise ( ( resolve , reject ) => {
152- let connectionTimeout = setTimeout ( ( ) => reject ( new Error ( 'Timeout connecting to server' ) ) , this . timeoutConnection )
152+ const connectionTimeout = setTimeout ( ( ) => reject ( new Error ( 'Timeout connecting to server' ) ) , this . timeoutConnection )
153153 this . logger . debug ( 'Connecting to' , this . client . host , ':' , this . client . port )
154154 this . _changeState ( STATE_CONNECTING )
155155 this . client . connect ( ) . then ( ( ) => {
@@ -217,7 +217,7 @@ export default class Client {
217217 this . logger . debug ( 'Updating id...' )
218218
219219 const command = 'ID'
220- const attributes = id ? [ flatten ( Object . entries ( id ) ) ] : [ null ]
220+ const attributes = id ? [ flatten ( Object . entries ( id ) ) ] : [ null ]
221221 const response = await this . exec ( { command, attributes } , 'ID' )
222222 const list = flatten ( pathOr ( [ ] , [ 'payload' , 'ID' , '0' , 'attributes' , '0' ] , response ) . map ( Object . values ) )
223223 const keys = list . filter ( ( _ , i ) => i % 2 === 0 )
@@ -255,7 +255,7 @@ export default class Client {
255255 * @returns {Promise } Promise with information about the selected mailbox
256256 */
257257 async selectMailbox ( path , options = { } ) {
258- let query = {
258+ const query = {
259259 command : options . readOnly ? 'EXAMINE' : 'SELECT' ,
260260 attributes : [ { type : 'STRING' , value : path } ]
261261 }
@@ -266,7 +266,7 @@ export default class Client {
266266
267267 this . logger . debug ( 'Opening' , path , '...' )
268268 const response = await this . exec ( query , [ 'EXISTS' , 'FLAGS' , 'OK' ] , { ctx : options . ctx } )
269- let mailboxInfo = parseSELECT ( response )
269+ const mailboxInfo = parseSELECT ( response )
270270
271271 this . _changeState ( STATE_SELECTED )
272272
@@ -493,8 +493,8 @@ export default class Client {
493493 * @returns {Promise } Promise with the array of matching seq. or uid numbers
494494 */
495495 async upload ( destination , message , options = { } ) {
496- let flags = propOr ( [ '\\Seen' ] , 'flags' , options ) . map ( value => ( { type : 'atom' , value } ) )
497- let command = {
496+ const flags = propOr ( [ '\\Seen' ] , 'flags' , options ) . map ( value => ( { type : 'atom' , value } ) )
497+ const command = {
498498 command : 'APPEND' ,
499499 attributes : [
500500 { type : 'atom' , value : destination } ,
@@ -639,7 +639,7 @@ export default class Client {
639639 */
640640 async login ( auth ) {
641641 let command
642- let options = { }
642+ const options = { }
643643
644644 if ( ! auth ) {
645645 throw new Error ( 'Authentication information not provided' )
@@ -842,7 +842,7 @@ export default class Client {
842842 * @param {Function } next Until called, server responses are not processed
843843 */
844844 _untaggedExistsHandler ( response ) {
845- if ( response && response . hasOwnProperty ( 'nr' ) ) {
845+ if ( response && Object . prototype . hasOwnProperty . call ( response , 'nr' ) ) {
846846 this . onupdate && this . onupdate ( this . _selectedMailbox , 'exists' , response . nr )
847847 }
848848 }
@@ -854,7 +854,7 @@ export default class Client {
854854 * @param {Function } next Until called, server responses are not processed
855855 */
856856 _untaggedExpungeHandler ( response ) {
857- if ( response && response . hasOwnProperty ( 'nr' ) ) {
857+ if ( response && Object . prototype . hasOwnProperty . call ( response , 'nr' ) ) {
858858 this . onupdate && this . onupdate ( this . _selectedMailbox , 'expunge' , response . nr )
859859 }
860860 }
0 commit comments