Skip to content

Commit

Permalink
Check put before get in Gun.chain.get.next for lex
Browse files Browse the repository at this point in the history
  • Loading branch information
mblaney committed Aug 10, 2024
1 parent 30248a8 commit 775efd7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gun.js
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@
if(tmp = ((tmp = lex['#'])||'')['='] || tmp){ return gun.get(tmp) }
(tmp = gun.chain()._).lex = lex; // LEX!
gun.on('in', function(eve){
if(String.match(eve.get|| (eve.put||'')['.'], lex['.'] || lex['#'] || lex)){
if(String.match((eve.put||'')['.'] || eve.get, lex['.'] || lex['#'] || lex)){
tmp.on('in', eve);
}
this.to.next(eve);
Expand Down
4 changes: 2 additions & 2 deletions src/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Gun.chain.get.next = function(gun, lex){ var tmp;
if(tmp = ((tmp = lex['#'])||'')['='] || tmp){ return gun.get(tmp) }
(tmp = gun.chain()._).lex = lex; // LEX!
gun.on('in', function(eve){
if(String.match(eve.get|| (eve.put||'')['.'], lex['.'] || lex['#'] || lex)){
if(String.match((eve.put||'')['.'] || eve.get, lex['.'] || lex['#'] || lex)){
tmp.on('in', eve);
}
this.to.next(eve);
Expand Down Expand Up @@ -43,4 +43,4 @@ function map(msg){ this.to.next(msg);
}
var noop = function(){}, event = {stun: noop, off: noop}, u;

}());
}());

0 comments on commit 775efd7

Please sign in to comment.