From e905c139d7f9c7bd8252e1b3792574ef916b4fda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Astori?= Date: Wed, 12 Oct 2016 04:00:04 -0400 Subject: [PATCH] Use native ES5 map method instead of lodash's --- src/client.js | 9 +-------- src/clientManager.js | 5 +---- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/client.js b/src/client.js index 70f8daa6..6e08d814 100644 --- a/src/client.js +++ b/src/client.js @@ -458,14 +458,7 @@ Client.prototype.save = function(force) { return; } - var networks = _.map( - this.networks, - function(n) { - return n.export(); - } - ); - var json = {}; - json.networks = networks; + json.networks = this.networks.map(n => n.export()); client.manager.updateUser(client.name, json); }; diff --git a/src/clientManager.js b/src/clientManager.js index 120320af..f9b2d043 100644 --- a/src/clientManager.js +++ b/src/clientManager.js @@ -143,10 +143,7 @@ ClientManager.prototype.removeUser = function(name) { ClientManager.prototype.autoload = function(/* sockets */) { var self = this; setInterval(function() { - var loaded = _.map( - self.clients, - "name" - ); + var loaded = self.clients.map(c => c.name); var added = _.difference(self.getUsers(), loaded); added.forEach(name => self.loadUser(name));