mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
fix Reverse RAD!
This commit is contained in:
parent
1abcfe0c83
commit
32a68c2d4d
@ -236,17 +236,22 @@
|
||||
// if a node is requested and some of it is cached... the other parts might not be.
|
||||
//}
|
||||
}
|
||||
o.span = (u !== o.start) || (u !== o.end);
|
||||
var g = function Get(){};
|
||||
g.lex = function(file){ var tmp;
|
||||
file = (u === file)? u : decodeURIComponent(file);
|
||||
tmp = o.next || key || (o.reverse? o.end || '\uffff' : o.start || '');
|
||||
if(!file || (o.reverse? file < tmp : file > tmp)){
|
||||
if(o.next){ g.file = file }
|
||||
if(o.next || o.reverse){ g.file = file }
|
||||
if(tmp = Q[g.file]){
|
||||
tmp.push({key: key, ack: cb, file: g.file, opt: o});
|
||||
return true;
|
||||
}
|
||||
Q[g.file] = [{key: key, ack: cb, file: g.file, opt: o}];
|
||||
if(!g.file){
|
||||
g.it(null, u, {});
|
||||
return true;
|
||||
}
|
||||
r.parse(g.file, g.it);
|
||||
return true;
|
||||
}
|
||||
@ -267,8 +272,10 @@
|
||||
if(!o.some){ o.some = (u !== data) }
|
||||
if(u !== data){ as.ack(g.err, data, o) }
|
||||
else if(!as.file){ !o.some && as.ack(g.err, u, o); return }
|
||||
if(/*!last || */last === tmp){ !o.some && as.ack(g.err, u, o); return }
|
||||
if(last && last > tmp && 0 != last.indexOf(tmp)){ !o.some && as.ack(g.err, u, o); return }
|
||||
if(!o.span){
|
||||
if(/*!last || */last === tmp){ !o.some && as.ack(g.err, u, o); return }
|
||||
if(last && last > tmp && 0 != last.indexOf(tmp)){ !o.some && as.ack(g.err, u, o); return }
|
||||
}
|
||||
if(o.some && o.parsed >= o.limit){ return }
|
||||
o.next = as.file;
|
||||
r.read(tmp, as.ack, o);
|
||||
@ -322,7 +329,6 @@
|
||||
return map(q, p.ack);
|
||||
}
|
||||
}
|
||||
|
||||
var start; LOG && (start = (+new Date)); // keep this commented out in production!
|
||||
var tmp = p.split(data), pre = [], i, k, v;
|
||||
if(!tmp || 0 !== tmp[1]){
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gun",
|
||||
"version": "0.2019.422",
|
||||
"version": "0.2019.423",
|
||||
"description": "A realtime, decentralized, offline-first, graph data synchronization engine.",
|
||||
"main": "index.js",
|
||||
"browser": "gun.js",
|
||||
|
@ -6,6 +6,8 @@ describe('Gun', function(){
|
||||
if(typeof window !== 'undefined'){ env = window }
|
||||
root = env.window? env.window : global;
|
||||
try{ env.window && root.localStorage && root.localStorage.clear() }catch(e){}
|
||||
try{ localStorage.clear() }catch(e){}
|
||||
try{ indexedDB.deleteDatabase('radatatest') }catch(e){}
|
||||
try{ require('fs').unlinkSync('data.json') }catch(e){}
|
||||
try{ require('../lib/fsrm')('radatatest') }catch(e){}
|
||||
//root.Gun = root.Gun || require('../gun');
|
||||
|
Loading…
x
Reference in New Issue
Block a user