mix.js 502 B

1234567891011121314151617
  1. ;(function(){
  2. var Gun = (typeof window !== "undefined")? window.Gun : require('../gun');
  3. Gun.state.node = function(node, vertex, opt){
  4. opt = opt || {};
  5. opt.state = opt.state || Gun.state();
  6. var now = Gun.obj.copy(vertex);
  7. Gun.node.is(node, function(val, key){
  8. var ham = Gun.HAM(opt.state, Gun.state.is(node, key), Gun.state.is(vertex, key), val, vertex[key]);
  9. if(!ham.incoming){
  10. // if(ham.defer){}
  11. return;
  12. }
  13. now = Gun.state.to(node, key, now);
  14. });
  15. return now;
  16. }
  17. }());