diff --git a/lib/path.js b/lib/path.js index d034cdbf..780d0f46 100644 --- a/lib/path.js +++ b/lib/path.js @@ -1,18 +1,15 @@ if(typeof window !== "undefined"){ var Gun = window.Gun; } else { - var Gun = require('gun/gun'); + var Gun = require('../gun'); } -Gun.chain.path = function(field, cb, opt){ +Gun.chain.path = function(field, opt){ var back = this, gun = back, tmp; - opt = opt || {}; opt.path = true; - if(gun === gun.back(-1)){if(cb){cb({err: Gun.log("Can't do that on root instance.")})}return gun} if(typeof field === 'string'){ - tmp = field.split(opt.split || '.'); + tmp = field.split(opt || '.'); if(1 === tmp.length){ - gun = back.get(field, cb, opt); - gun._.opt = opt; + gun = back.get(field); return gun; } field = tmp; @@ -22,19 +19,17 @@ Gun.chain.path = function(field, cb, opt){ gun = back; var i = 0, l = field.length; for(i; i < l; i++){ - gun = gun.get(field[i], (i+1 === l)? cb : null, opt); + //gun = gun.get(field[i], (i+1 === l)? cb : null, opt); + gun = gun.get(field[i]); } - //gun.back = back; // TODO: API change! } else { - gun = back.get(field[0], cb, opt); + gun = back.get(field[0]); } - gun._.opt = opt; return gun; } if(!field && 0 != field){ return back; } - gun = back.get(''+field, cb, opt); - gun._.opt = opt; + gun = back.get(''+field); return gun; } \ No newline at end of file diff --git a/package.json b/package.json index 4e1f9f53..7bb359a0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gun", - "version": "0.9.9993", + "version": "0.9.9994", "description": "A realtime, decentralized, offline-first, graph data synchronization engine.", "main": "index.js", "browser": "gun.min.js",