Use native ES5 map method instead of lodash's

This commit is contained in:
Jérémie Astori 2016-10-12 04:00:04 -04:00
parent 089c315a8e
commit e905c139d7
2 changed files with 2 additions and 12 deletions

View File

@ -458,14 +458,7 @@ Client.prototype.save = function(force) {
return; return;
} }
var networks = _.map(
this.networks,
function(n) {
return n.export();
}
);
var json = {}; var json = {};
json.networks = networks; json.networks = this.networks.map(n => n.export());
client.manager.updateUser(client.name, json); client.manager.updateUser(client.name, json);
}; };

View File

@ -143,10 +143,7 @@ ClientManager.prototype.removeUser = function(name) {
ClientManager.prototype.autoload = function(/* sockets */) { ClientManager.prototype.autoload = function(/* sockets */) {
var self = this; var self = this;
setInterval(function() { setInterval(function() {
var loaded = _.map( var loaded = self.clients.map(c => c.name);
self.clients,
"name"
);
var added = _.difference(self.getUsers(), loaded); var added = _.difference(self.getUsers(), loaded);
added.forEach(name => self.loadUser(name)); added.forEach(name => self.loadUser(name));