Merge pull request #200 from amark/develop

Develop
This commit is contained in:
Mark Nadal 2016-07-05 11:39:42 -06:00 committed by GitHub
commit 838dbec737
2 changed files with 5 additions and 3 deletions

6
gun.js
View File

@ -538,13 +538,15 @@
var gun = this, root = (gun.__ && gun.__.gun)? gun.__.gun : (gun._ = gun.__ = {gun: gun}).gun.chain(); // if root does not exist, then create a root chain.
root.__.by = root.__.by || function(f){ return gun.__.by[f] = gun.__.by[f] || {} };
root.__.graph = root.__.graph || {};
root.__.opt = root.__.opt || {};
root.__.opt = root.__.opt || {peers: {}};
root.__.opt.wire = root.__.opt.wire || {};
if(Gun.text.is(opt)){ opt = {peers: opt} }
if(Gun.list.is(opt)){ opt = {peers: opt} }
if(Gun.text.is(opt.peers)){ opt.peers = [opt.peers] }
if(Gun.list.is(opt.peers)){ opt.peers = Gun.obj.map(opt.peers, function(n,f,m){ m(n,{}) }) }
root.__.opt.peers = opt.peers || gun.__.opt.peers || {};
Gun.obj.map(opt.peers, function(v, f){
root.__.opt.peers[f] = v;
});
Gun.obj.map(opt.wire, function(h, f){
if(!Gun.fns.is(h)){ return }
root.__.opt.wire[f] = h;

View File

@ -1,6 +1,6 @@
{
"name": "gun",
"version": "0.3.94",
"version": "0.3.95",
"description": "Graph engine",
"main": "index.js",
"scripts": {