mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Use Array.indexOf() instead of Array.includes()
This commit is contained in:
parent
fbe0e2d6eb
commit
7aced85a31
@ -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];
|
||||
}
|
||||
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user