Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function(next) {
// Flush any existing mempool index
if (fs.existsSync(self.mempoolIndexPath)) {
leveldown.destroy(self.mempoolIndexPath, next);
} else {
setImmediate(next);
}
},
function(next) {
server.doorknob.db.close(function() {
leveldown.destroy(path.join(__dirname, 'test.db'), cb)
})
}
function deleteStore (store, cb) {
if (leveldown) {
return leveldown.destroy(store.store.location, cb)
}
cb(null)
}
function deleteStore (store, cb) {
if (leveldown) {
return leveldown.destroy(store.store.location, cb)
}
cb(null)
}
done.forEach(function (item) {
leveldown.destroy(item, function () {
if (++todo === done.length) {
fs.rmdir(base, callback);
}
});
});
}
function destroyDatabase(callback) {
db.close();
require('leveldown').destroy(DB_NAME, callback);
db = null;
generalDb = null;
}
destroy(callback) {
leveldown.destroy(this.levelup.location, callback);
}
db.close(function() {
require('leveldown').destroy(path, function() {
db = levelup(path, {
maxOpenFiles: 500
});
return cb();
});
});
};
done.forEach(function (item) {
leveldown.destroy(item, function () {
if (++todo === done.length) {
fs.rmdir(base, callback);
}
});
});
}