Skip to content

Commit

Permalink
style: some linter changes
Browse files Browse the repository at this point in the history
  • Loading branch information
newgene committed Jun 15, 2021
1 parent ef2ac87 commit 1f7ec7f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions src/batch_edge_query.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = class BatchEdgeQueryHandler {
* @private
*/
_expandBTEEdges(bteEdges) {
debug(`BTE EDGE ${JSON.stringify(this.qEdges)}`)
debug(`BTE EDGE ${JSON.stringify(this.qEdges)}`);
return bteEdges;
}

Expand All @@ -50,21 +50,21 @@ module.exports = class BatchEdgeQueryHandler {
*/
async _postQueryFilter(response) {
try {
const filtered = response.filter(item => {
let edge_predicate = item['$edge_metadata']['predicate']
let predicate_filters = item['$edge_metadata']['trapi_qEdge_obj']['qEdge']['predicate']
const filtered = response.filter((item) => {
let edge_predicate = item['$edge_metadata']['predicate'];
let predicate_filters = item['$edge_metadata']['trapi_qEdge_obj']['qEdge']['predicate'];
//remove prefix from filter list to match predicate name format
predicate_filters = predicate_filters.map(item => utils.removeBioLinkPrefix(item))
predicate_filters = predicate_filters.map((item) => utils.removeBioLinkPrefix(item));
//compare edge predicate to filter list
if (predicate_filters.includes(edge_predicate)) {
return item
return item;
}
});
debug(`Filtered results from ${response.length} down to ${filtered.length} results`);
return filtered
return filtered;
} catch (error) {
debug(`Failed to filter ${response.length} results due to ${error}`);
return response
return response;
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/qedge2bteedge.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ module.exports = class QEdge2BTEEdgeHandler {
new LogEntry(
'DEBUG',
null,
`BTE is trying to find SmartAPI edges connecting from ${qEdge
.getSubject()
.getCategories()} to ${qEdge.getObject().getCategories()} with predicate ${qEdge.getPredicate()}`,
`BTE is trying to find SmartAPI edges connecting from ${qEdge.getSubject().getCategories()} to ${qEdge
.getObject()
.getCategories()} with predicate ${qEdge.getPredicate()}`,
).getLog(),
);
let filterCriteria = {
Expand Down
6 changes: 3 additions & 3 deletions src/query_edge.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ module.exports = class QEdge {
this.predicate = info.predicates;
this.subject = info.subject;
this.object = info.object;
this.expanded_predicates = []
this.init()
this.expanded_predicates = [];
this.init();
}

init() {
this.expanded_predicates = this.getPredicate()
this.expanded_predicates = this.getPredicate();
}

getID() {
Expand Down
2 changes: 1 addition & 1 deletion src/query_graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ module.exports = class QueryGraphHandler {
`BTE identified your query graph as a ${Object.keys(paths).length}-depth query graph`,
).getLog(),
);
debug(`ALL PATHS ${JSON.stringify(paths)}`)
debug(`ALL PATHS ${JSON.stringify(paths)}`);
return paths;
}

Expand Down

0 comments on commit 1f7ec7f

Please sign in to comment.