Use Array.indexOf() instead of Array.includes()

This commit is contained in:
Hiroki Uchikawa 2018-06-04 13:04:56 +09:00 committed by HirokiUchikawa
parent fbe0e2d6eb
commit 7aced85a31
2 changed files with 2 additions and 2 deletions

View File

@ -139,7 +139,7 @@ LocalFileSystem.prototype.clean = function(activeNodes){
var self = this;
return fs.readdir(self.storageBaseDir).then(function(dirs){
return when.all(dirs.reduce(function(result, item){
if(item !== "global" && !activeNodes.includes(item)){
if(item !== "global" && activeNodes.indexOf(item) === -1){
result.push(fs.remove(path.join(self.storageBaseDir,item)));
delete self.storages[item];
}

View File

@ -77,7 +77,7 @@ Memory.prototype.clean = function(activeNodes){
for(var id in this.data){
if(this.data.hasOwnProperty(id) && id !== "global"){
var idParts = id.split(":");
if(!activeNodes.includes(idParts[0])){
if(!activeNodes.indexOf(idParts[0])){
delete this.data[id];
}
}