Skip to content

Commit

Permalink
Strict ID comparison to avoid exclude nodes (#81)
Browse files Browse the repository at this point in the history
* Add strict id comparation to avoid exclude nodes

* Add strict type comparison for string type
  • Loading branch information
rogelio-o authored and bricaud committed Jan 12, 2020
1 parent 2d790f9 commit c51678b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.DS_Store

d3/
font-awesome-4.7.0/
jquery*
4 changes: 2 additions & 2 deletions scripts/graphioGremlin.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ var graphioGremlin = (function(){
var edge_filter = $('#edge_filter').val();
var communication_method = $('#communication_method').val();
var id = d.id;
if(isNaN(id)){ // Add quotes if id is a string (not a number).
if (typeof id === 'string' || id instanceof String) { // Add quotes if id is a string (not a number).
id = '"'+id+'"';
}
// Gremlin query
Expand Down Expand Up @@ -442,7 +442,7 @@ var graphioGremlin = (function(){
// find the element in list with id equal to elem
// return its index or null if there is no
for (var i=0;i<list.length;i++) {
if (list[i].id == elem) return i;
if (list[i].id === elem) return i;
}
return null;
}
Expand Down

0 comments on commit c51678b

Please sign in to comment.