diff --git a/src/adapters/localStorage.js b/src/adapters/localStorage.js index 5c8f0302..d2a170f7 100644 --- a/src/adapters/localStorage.js +++ b/src/adapters/localStorage.js @@ -84,7 +84,7 @@ Gun.on('create', function(root){ var disk = Gun.obj.ify(store.getItem(opt.prefix)) || {}; var lS = function(){}, u; root.on('localStorage', disk); // NON-STANDARD EVENT! - + root.on('put', function(at){ this.to.next(at); Gun.graph.is(at.put, null, map); @@ -130,7 +130,7 @@ Gun.on('create', function(root){ acks = {}; if(data){ disk = data } try{store.setItem(opt.prefix, JSON.stringify(disk)); - }catch(e){ + }catch(e){ Gun.log(err = (e || "localStorage failure") + " Consider using GUN's IndexedDB plugin for RAD for more storage space, temporary example at https://github.com/amark/gun/blob/master/test/tmp/indexedDB.html ."); root.on('localStorage:error', {err: err, file: opt.prefix, flush: disk, retry: flush}); } diff --git a/src/adapters/mesh.js b/src/adapters/mesh.js index 790beaed..f26e819f 100644 --- a/src/adapters/mesh.js +++ b/src/adapters/mesh.js @@ -57,8 +57,9 @@ function Mesh(ctx){ } return; } + ctx.on('in', msg); - + return; } else if('[' === tmp){ diff --git a/src/chain.js b/src/chain.js index c2a1d20d..0105cd07 100644 --- a/src/chain.js +++ b/src/chain.js @@ -139,7 +139,7 @@ function input(msg){ //if(tmp[cat.id]){ return } tmp.is = tmp.is || at.put; tmp[cat.id] = at.put || true; - //if(root.stop){ + //if(root.stop){ eve.to.next(msg) //} relate(cat, msg, at, rel); @@ -152,7 +152,7 @@ function relate(at, msg, from, rel){ var tmp = (at.root.$.get(rel)._); if(at.has){ from = tmp; - } else + } else if(from.has){ relate(from, msg, from, rel); } @@ -204,7 +204,7 @@ function map(data, key){ // Map over only the changes on every update. if(tmp = via.$){ tmp = (chain = via.$.get(key))._; if(u === tmp.put || !Gun.val.link.is(data)){ - tmp.put = data; + tmp.put = data; } } at.on('in', { diff --git a/src/get.js b/src/get.js index 6f5ab51d..a71e08ce 100644 --- a/src/get.js +++ b/src/get.js @@ -88,7 +88,7 @@ function use(msg){ //root.stop && (root.stop.ID = root.stop.ID || Gun.text.random(2)); //if((tmp = root.stop) && (tmp = tmp[at.id] || (tmp[at.id] = {})) && tmp[cat.id]){ return } tmp && (tmp[cat.id] = true); - if(eve.seen && at.id && eve.seen[at.id]){ return eve.to.next(msg) } + if(eve.seen && at.id && eve.seen[at.id]){ return eve.to.next(msg) } //if((tmp = root.stop)){ if(tmp[at.id]){ return } tmp[at.id] = msg.root; } // temporary fix till a better solution? if((tmp = data) && tmp[rel._] && (tmp = rel.is(tmp))){ tmp = ((msg.$$ = at.root.gun.get(tmp))._); diff --git a/src/onto.js b/src/onto.js index 78827257..4851d32b 100644 --- a/src/onto.js +++ b/src/onto.js @@ -5,13 +5,13 @@ module.exports = function onto(tag, arg, as){ var u, tag = (this.tag || (this.tag = {}))[tag] || (this.tag[tag] = {tag: tag, to: onto._ = { next: function(arg){ var tmp; - if((tmp = this.to)){ + if((tmp = this.to)){ tmp.next(arg); }} }}); if(arg instanceof Function){ var be = { - off: onto.off || + off: onto.off || (onto.off = function(){ if(this.next === onto._.next){ return !0 } if(this === this.the.last){ diff --git a/src/root.js b/src/root.js index 242f53ee..642a96b7 100644 --- a/src/root.js +++ b/src/root.js @@ -104,7 +104,7 @@ Gun.dup = require('./dup'); if(!at){ if(!(cat.opt||empty).super){ ctx.souls[soul] = false; - return; + return; } at = (ctx.$.get(soul)._); } diff --git a/src/state.js b/src/state.js index 16ef2ca6..1cddd3f1 100644 --- a/src/state.js +++ b/src/state.js @@ -26,10 +26,10 @@ State.lex = function(){ return State().toString(36).replace('.','') } State.ify = function(n, k, s, v, soul){ // put a key's state on a node. if(!n || !n[N_]){ // reject if it is not node-like. if(!soul){ // unless they passed a soul - return; + return; } n = Node.soul.ify(n, soul); // then make it so! - } + } var tmp = obj_as(n[N_], State._); // grab the states data. if(u !== k && k !== N_){ if(num_is(s)){ diff --git a/src/val.js b/src/val.js index fa4ac8f7..fb7cf4ee 100644 --- a/src/val.js +++ b/src/val.js @@ -7,7 +7,7 @@ Val.is = function(v){ // Valid values are a subset of JSON: null, binary, number if(v === Infinity){ return false } // we want this to be, but JSON does not support it, sad face. if(text_is(v) // by "text" we mean strings. || bi_is(v) // by "binary" we mean boolean. - || num_is(v)){ // by "number" we mean integers or decimals. + || num_is(v)){ // by "number" we mean integers or decimals. return true; // simple values are valid. } return Val.rel.is(v) || false; // is the value a soul relation? Then it is valid and return it. If not, everything else remaining is an invalid data type. Custom extensions can be built on top of these primitives to support other types.