Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(config) {
config = config || {};
let DB;
if (config.level) {
DB = config.level;
} else {
let dbPath = config.dbPath || process.env['PATH_TO_MESH_DB'] || 'dbtest';
DB = level(dbPath);
}
this.db = levelgraphN3(levelgraph(DB));
this.dbSearch = Promise.promisify(this.db.search, {multiArgs: false});
}
RecommendationsService.prototype.initDb = function() {
this.graphLevel = level(this.graphPath);
this.graph = levelgraph(this.graphLevel);
this.graphPut = pify(this.graph.put.bind(this.graph));
this.graphSearch = pify(this.graph.search.bind(this.graph));
};