mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
don't be invalid!
This commit is contained in:
parent
85ee6fd07c
commit
b95b25fd94
4
gun.js
4
gun.js
@ -349,7 +349,7 @@
|
||||
if(!(meta = (node||{})[Gun._.meta]) || !(meta = meta[Gun._.state]) || !Gun.num.is(meta[field])){
|
||||
return ctx.err = {err: Gun.log("No state on '" + field + "'!") }
|
||||
}
|
||||
}) || ctx.err){ return ctx.err = ctx.err || {err: Gun.log("Invalid graph!")}, ctx }
|
||||
}) || ctx.err){ return ctx.err = ctx.err || {err: Gun.log("Invalid graph!", prime)}, ctx }
|
||||
function emit(at){
|
||||
Gun.on('operating').emit(gun, at);
|
||||
}
|
||||
@ -714,7 +714,7 @@
|
||||
at.soul = opt.key.soul;
|
||||
gun.__.by(opt.key.soul).node = Gun.union.ify(gun, opt.key.soul); // TODO: Check performance?
|
||||
gun.__.by(opt.key.soul).node._['key'] = 'pseudo';
|
||||
at.change = Gun.is.node.soul.ify(at.change || gun.__.by(at.soul).node, at.soul, true);
|
||||
at.change = Gun.is.node.soul.ify(Gun.obj.copy(at.change || gun.__.by(at.soul).node), at.soul, true); // TODO: Check performance?
|
||||
return;
|
||||
}
|
||||
var node = at.change || gun.__.graph[at.soul];
|
||||
|
@ -3486,6 +3486,21 @@ describe('Gun', function(){
|
||||
done();
|
||||
})
|
||||
});
|
||||
|
||||
it("no invalid graph", function(done){
|
||||
var gun = Gun({wire:{
|
||||
put: function(graph){
|
||||
expect(Gun.is.graph(graph)).to.be.ok();
|
||||
if(done.c){ return } if(done.on){ done(); done.c = 1 }
|
||||
}
|
||||
}}).get('example/todo/data/graph');
|
||||
gun.on(function renderToDo(val){
|
||||
done.on = true;
|
||||
});
|
||||
setTimeout(function(){
|
||||
gun.path(Gun.text.random()).put('hoorah');
|
||||
},100)
|
||||
});
|
||||
});
|
||||
|
||||
describe('Streams', function(){
|
||||
|
Loading…
x
Reference in New Issue
Block a user