Browse Source

tidy bin.js

Kieran Gibb 2 years ago
parent
commit
5e20980e45
No known key found for this signature in database
1 changed files with 8 additions and 8 deletions
  1. 8
    8
      bin.js

+ 8
- 8
bin.js View File

@@ -48,17 +48,18 @@ function Application (opts) {
48 48
   }
49 49
 
50 50
   function defaultViews (storage) {
51
-    if (storage) {
52
-      var views = path.join(path.resolve(storage), 'views')
53
-      mkdirp.sync(views)
54
-      return level(views)
55
-    }
56
-    return memdb()
51
+    if (!storage) return memdb()
52
+    var views = path.join(path.resolve(storage), 'views')
53
+    mkdirp.sync(views)
54
+    return level(views)
57 55
   }
58 56
 
59 57
   function Swarm (drive, opts = {}) {
60 58
     var swarm = hyperswarm()
61
-    swarm.join(drive.discoveryKey, { lookup: true, announce: true })
59
+    swarm.join(drive.discoveryKey, {
60
+      lookup: true,
61
+      announce: true
62
+    })
62 63
     console.log(`swarming on ${hex(drive.discoveryKey)}`)
63 64
 
64 65
     swarm.on('connection', (socket, details) => {
@@ -69,7 +70,6 @@ function Application (opts) {
69 70
 
70 71
     return swarm
71 72
   }
72
-
73 73
 }
74 74
 
75 75
 function hex (buf) {