Skip to content

Commit

Permalink
fix: replaced redundant map with forEach
Browse files Browse the repository at this point in the history
  • Loading branch information
NeuralFlux committed Aug 5, 2024
1 parent 1961f2d commit d0b2ab5
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,15 +319,12 @@ export default class TRAPIQueryHandler {

appendOriginalCuriesToResults(results: TrapiResult[]): void {
results.forEach(result => {
Object.entries(result.node_bindings).map(([qNodeID, bindings]) => {
return [
qNodeID,
bindings.forEach((binding) => {
if (this.bteGraph.nodes[binding.id].originalCurie && this.bteGraph.nodes[binding.id].originalCurie !== binding.id) {
binding.query_id = this.bteGraph.nodes[binding.id].originalCurie;
}
})
]
Object.entries(result.node_bindings).forEach(([_, bindings]) => {
bindings.forEach(binding => {
if (this.bteGraph.nodes[binding.id].originalCurie && this.bteGraph.nodes[binding.id].originalCurie !== binding.id) {
binding.query_id = this.bteGraph.nodes[binding.id].originalCurie;
}
})
})
})
}
Expand Down

0 comments on commit d0b2ab5

Please sign in to comment.