diff --git a/gun.js b/gun.js index 5bb3097a..2be0c3ea 100644 --- a/gun.js +++ b/gun.js @@ -2217,8 +2217,11 @@ var gun = this, soul; cb = cb || function(){}; if(soul = Gun.node.soul(item)){ return gun.set(gun.back(-1).get(soul), cb, opt) } - if(Gun.obj.is(item) && !Gun.is(item)){ return gun.set(gun._.root.put(item), cb, opt) } - return item.get('_').get(function(at, ev){ + if(!Gun.is(item)){ + if(Gun.obj.is(item)){ return gun.set(gun._.root.put(item), cb, opt) } + return gun.get(Gun.text.random()).put(item); + } + item.get('_').get(function(at, ev){ if(!at.gun || !at.gun._.back); ev.off(); at = (at.gun._.back._); @@ -2226,6 +2229,7 @@ if(!soul){ return cb.call(gun, {err: Gun.log('Only a node can be linked! Not "' + node + '"!')}) } gun.put(Gun.obj.put(put, soul, Gun.val.rel.ify(soul)), cb, opt); },{wait:0}); + return item; } })(require, './set'); diff --git a/package.json b/package.json index c077c6d8..5960356a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gun", - "version": "0.6.4", + "version": "0.6.5", "description": "Graph engine", "main": "index.js", "browser": "gun.min.js",