Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (filesOrder) {
var curIndex = filesOrder.indexOf(cur);
if (curIndex !== -1) {
var nextIndex = filesOrder.indexOf(next);
if (nextIndex !== -1) {
return compare(curIndex, nextIndex);
}
}
}
cur = files[cur];
next = files[next];
return compare(cur.index, next.index);
});
this._cache.properties['filesOrder'] = filesOrder;
fse.outputJsonSync(self._properties, self._cache.properties);
fse.outputJsonSync(self._backupProps, self._cache.properties);
fs.readdirSync(backupDir).forEach(function(file) {
if (fileNames[file]) {
return;
}
try {
fs.unlinkSync(path.join(backupDir, file));
} catch(e) {}
});
}
filesOrder = Object.keys(files).sort(function(cur, next) {
if (filesOrder) {
var curIndex = filesOrder.indexOf(cur);
if (curIndex !== -1) {
var nextIndex = filesOrder.indexOf(next);
if (nextIndex !== -1) {
return compare(curIndex, nextIndex);
}
}
}
cur = files[cur];
next = files[next];
return compare(cur.index, next.index);
});
this._cache.properties['filesOrder'] = filesOrder;
fse.outputJsonSync(self._properties, self._cache.properties);
fse.outputJsonSync(self._backupProps, self._cache.properties);
fs.readdirSync(backupDir).forEach(function(file) {
if (fileNames[file]) {
return;
}
try {
fs.unlinkSync(path.join(backupDir, file));
} catch(e) {}
});
}