From 99f6b08a3054d6ef46c6d467adaf847402179eb6 Mon Sep 17 00:00:00 2001 From: Jason Papakostas Date: Wed, 18 Apr 2018 16:08:23 -0500 Subject: [PATCH] fix 'this' shadowing --- src/channel.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/channel.js b/src/channel.js index 5f2c8cd7..f3f4dafe 100644 --- a/src/channel.js +++ b/src/channel.js @@ -74,7 +74,7 @@ module.exports = class IrcChannel { } // There can be multiple modes set at once, loop through - _.each(event.modes, function(mode) { + _.each(event.modes, mode => { // If this mode has a user prefix then we need to update the user object // eg. +o +h +v let user_prefix = _.find(irc_client.network.options.PREFIX, { @@ -85,9 +85,9 @@ module.exports = class IrcChannel { // TODO : manage channel mode changes } else { // It's a user mode // Find the user affected - let user = _.find(this.users, function(user) { - return user.nick.toLowerCase() === mode.param.toLowerCase(); - }); + let user = _.find(this.users, user => + user.nick.toLowerCase() === mode.param.toLowerCase() + ); if (!user) { return;