diff --git a/examples/start.js.html b/examples/start.js.html new file mode 100644 index 00000000..0341e360 --- /dev/null +++ b/examples/start.js.html @@ -0,0 +1,17 @@ +/* + + + + \ No newline at end of file diff --git a/gun.js b/gun.js index c825123f..3524febd 100644 --- a/gun.js +++ b/gun.js @@ -2067,7 +2067,7 @@ peer.say(raw); } else if(wire.send){ - if(wire.readyState && 1 != wire.readyState){ return } + if(wire.readyState && 1 != wire.readyState){ throw "socket not ready yet!" } wire.send(raw); } }catch(e){ diff --git a/lib/hub.js b/lib/hub.js new file mode 100644 index 00000000..38db6ee1 --- /dev/null +++ b/lib/hub.js @@ -0,0 +1,5 @@ +var fs = require('fs'); + +fs.watch('.', {persistent: false, recursive: true}, function(eve, name){ + console.log("changed!", eve, name); +}) \ No newline at end of file diff --git a/lib/ipfs.js b/lib/ipfs.js index 789fdbb0..5d183217 100644 --- a/lib/ipfs.js +++ b/lib/ipfs.js @@ -1,3 +1,4 @@ +console.log("IPFS PLUGIN NOT OFFICIALLY MAINTAINED! PROBABLY WON'T WORK! USE AT YOUR OWN RISK! PLEASE CONTRIBUTE FIXES!"); var opt = gun._.opt, u; if (u === opt.ipfs.directory) { opt.ipfs.directory = '/gun'; @@ -42,4 +43,4 @@ opt.store.list = function(cb){ stream.on('finish', () => { cb(); }); -} +} \ No newline at end of file diff --git a/lib/store.js b/lib/store.js index 10591ac1..0b7b1e38 100644 --- a/lib/store.js +++ b/lib/store.js @@ -35,21 +35,21 @@ Gun.on('create', function(root){ root.on('get', function(msg){ this.to.next(msg); - var id = msg['#'], get = msg.get, soul = msg.get['#'], has = msg.get['.']||'', opt = {}, graph, lex, key, tmp; + var id = msg['#'], get = msg.get, soul = msg.get['#'], has = msg.get['.']||'', opt = {}, graph, lex, key, tmp, force; if(typeof soul == 'string'){ key = soul; } else if(soul){ - if(tmp = soul['*']){ opt.limit = 1 } - key = tmp || soul['=']; + if(u !== (tmp = soul['*'])){ opt.limit = force = 1 } + key = force? (''+tmp) : tmp || soul['=']; } if(key && !opt.limit){ // a soul.has must be on a soul, and not during soul* if(typeof has == 'string'){ key = key+esc+(opt.atom = has); } else if(has){ - if(tmp = has['*']){ opt.limit = 1 } - if(key){ key = key+esc + (tmp || (opt.atom = has['='])) } + if(u !== (tmp = has['*'])){ opt.limit = force = 1 } + if(key){ key = key+esc + (force? (''+tmp) : tmp || (opt.atom = has['='])) } } } if((tmp = get['%']) || opt.limit){ diff --git a/lib/wire.js b/lib/wire.js index c8b63505..5e74b6b3 100644 --- a/lib/wire.js +++ b/lib/wire.js @@ -74,7 +74,7 @@ Gun.on('opt', function(root){ wire.on('message', function(msg){ opt.mesh.hear(msg.data || msg, peer); }); - wire.on('close', function(a,b,c){ + wire.on('close', function(){ opt.mesh.bye(peer); }); wire.on('error', function(e){}); diff --git a/package-lock.json b/package-lock.json index c46e5dda..bd40b100 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "gun", - "version": "0.2019.413", + "version": "0.2019.416", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -724,9 +724,9 @@ "dev": true }, "nan": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", - "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==", + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", + "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==", "optional": true }, "negotiator": { @@ -736,15 +736,15 @@ "dev": true }, "node-webcrypto-ossl": { - "version": "1.0.39", - "resolved": "https://registry.npmjs.org/node-webcrypto-ossl/-/node-webcrypto-ossl-1.0.39.tgz", - "integrity": "sha512-cEq67y6GJ5jcKdANi5XqejqMvM/eIGxuOOE8F+c0XS950jSpvOcjUNHLmIe3/dN/UKyUkb+dri0BU4OgmCJd2g==", + "version": "1.0.43", + "resolved": "https://registry.npmjs.org/node-webcrypto-ossl/-/node-webcrypto-ossl-1.0.43.tgz", + "integrity": "sha512-AavMGbUB2MaTzli0+swjSAr4aLqf9M5jHIrs5VP9EUDXyEaIOyyio3H1z3pZCxKpaDD9coKWD3bWAiaIBuN8wg==", "optional": true, "requires": { "mkdirp": "^0.5.1", - "nan": "^2.11.1", + "nan": "^2.12.1", "tslib": "^1.9.3", - "webcrypto-core": "^0.1.25" + "webcrypto-core": "^0.1.26" } }, "object-assign": { diff --git a/package.json b/package.json index badb8ab8..bde8e40a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gun", - "version": "0.2019.413", + "version": "0.2019.416", "description": "A realtime, decentralized, offline-first, graph data synchronization engine.", "main": "index.js", "browser": "gun.js", @@ -54,7 +54,7 @@ }, "optionalDependencies": { "text-encoding": "^0.7.0", - "node-webcrypto-ossl": "^1.0.39" + "node-webcrypto-ossl": "^1.0.43" }, "devDependencies": { "aws-sdk": ">=2.153.0", diff --git a/test/tmp/contacts.html b/test/tmp/contacts.html index f0d62502..4e0be10d 100644 --- a/test/tmp/contacts.html +++ b/test/tmp/contacts.html @@ -16,8 +16,8 @@