Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return travel(data, a, b, this);
}
var gun = this, root = gun.back(-1);
var cb = (a instanceof Function && a) || (b instanceof Function && b);
if(Gun.is(data)){
data.get(function(soul){
if(!soul){
return cb && cb({err: "Timegraph cannot link `undefined`!"});
}
gun.time(Gun.val.link.ify(soul), a, b);
}, true);
return gun;
}
opt = (cb === a)? b : a;
opt = Gun.text.is(opt)? {key: opt} : opt || {};
var t = new Date(Gun.state()).toISOString().split(/[\-t\:\.z]/ig);
var p, tmp = t.pop();
gun.get(function(soul){
var id = soul;
p = id;
if(!p){ id = p = (gun.back('opt.uuid') || Gun.text.random)(9) }
// could shrink this into a loop. Do later?
t = [p].concat(t);
var rid = opt.key || (gun.back('opt.uuid') || Gun.text.random)(9);
var milli = ify({}, t.join(':'));
milli[rid] = data;
tmp = t.pop();
var sec = ify({}, t.join(':'));
sec[tmp] = milli;
tmp = t.pop();
var min = ify({}, t.join(':'));
min[tmp] = sec;
const union = function union(vertex, node, opt){
if(!node || !node._){ return }
vertex = vertex || Gun.state.to(node);
if(!vertex || !vertex._){ return }
opt = Gun.num.is(opt)? {machine: opt} : {machine: Gun.state()};
opt.union = Gun.obj.copy(vertex); // Slow performance.
if(!Gun.node.is(node, function(val, key){
var HAM = Gun.HAM(opt.machine, Gun.state.is(node, key), Gun.state.is(vertex, key, true), val, vertex[key]);
if(!HAM.incoming){ return }
Gun.state.to(node, key, opt.union);
})){ return }
return opt.union;
}
/* eslint-enable */
const time = () => new Date(Gun.state());
function now(t){
return new Date(t || Gun.state()).toISOString().split(/[\-t\:\.z]/ig).slice(0,-1);
}
function find(o, cb, root, at, off){
const time = () => new Date(Gun.state());