From 775efd72da81bef8207352053d3f0e2f5e594234 Mon Sep 17 00:00:00 2001 From: Malcolm Blaney Date: Sat, 10 Aug 2024 10:03:39 +1000 Subject: [PATCH] Check put before get in Gun.chain.get.next for lex --- gun.js | 2 +- src/map.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gun.js b/gun.js index fc34f07ba..241435f7d 100644 --- a/gun.js +++ b/gun.js @@ -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); diff --git a/src/map.js b/src/map.js index f6c5f9eb2..682cd9937 100644 --- a/src/map.js +++ b/src/map.js @@ -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); @@ -43,4 +43,4 @@ function map(msg){ this.to.next(msg); } var noop = function(){}, event = {stun: noop, off: noop}, u; -}()); \ No newline at end of file +}());