Skip to content
This repository was archived by the owner on Jan 7, 2022. It is now read-only.

Commit 2da1865

Browse files
committed
update deps and standard
1 parent 67b3000 commit 2da1865

13 files changed

Lines changed: 801 additions & 1644 deletions

File tree

examples/download.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if (!key) {
1313
var dest = path.join(__dirname, 'tmp')
1414
fs.mkdirSync(dest)
1515

16-
Dat(ram, {key: key, sparse: true}, function (err, dat) {
16+
Dat(ram, { key: key, sparse: true }, function (err, dat) {
1717
if (err) throw err
1818

1919
var network = dat.joinNetwork()
@@ -23,7 +23,7 @@ Dat(ram, {key: key, sparse: true}, function (err, dat) {
2323
dat.archive.metadata.update(download)
2424

2525
function download () {
26-
var progress = mirror({fs: dat.archive, name: '/'}, dest, function (err) {
26+
var progress = mirror({ fs: dat.archive, name: '/' }, dest, function (err) {
2727
if (err) throw err
2828
console.log('Done')
2929
})

examples/share.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var Dat = require('..')
33

44
var src = path.join(__dirname, '..')
55

6-
Dat(src, {temp: true}, function (err, dat) {
6+
Dat(src, { temp: true }, function (err, dat) {
77
if (err) throw err
88

99
var network = dat.joinNetwork()

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ function createDat (dirOrStorage, opts, cb) {
2727
opts = {}
2828
}
2929
assert.ok(dirOrStorage, 'dat-node: directory or storage required')
30-
assert.equal(typeof opts, 'object', 'dat-node: opts should be type object')
31-
assert.equal(typeof cb, 'function', 'dat-node: callback required')
30+
assert.strictEqual(typeof opts, 'object', 'dat-node: opts should be type object')
31+
assert.strictEqual(typeof cb, 'function', 'dat-node: callback required')
3232

3333
var archive
3434
var key = opts.key

lib/import-files.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function importer (archive, src, opts, cb) {
3737
// Dry Run Import to get initial import size
3838
importCount = { files: 0, bytes: 0 }
3939
var dryRunOpts = xtend(opts, { dryRun: true, watch: false }) // force right side opts
40-
var dryRun = mirror(src, {name: '/', fs: archive}, dryRunOpts, function (err) {
40+
var dryRun = mirror(src, { name: '/', fs: archive }, dryRunOpts, function (err) {
4141
if (err) return cb(err)
4242
progress.emit('count', importCount)
4343
})
@@ -49,7 +49,7 @@ function importer (archive, src, opts, cb) {
4949
}
5050

5151
// Importing
52-
progress = mirror(src, {name: '/', fs: archive}, opts, cb)
52+
progress = mirror(src, { name: '/', fs: archive }, opts, cb)
5353
progress.on('put-data', function (chunk, src, dst) {
5454
progress.indexSpeed = indexSpeed(chunk.length)
5555
})

lib/stats.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = function (archive) {
2626
stats.get = function () {
2727
return count
2828
}
29-
stats.network = networkSpeed(archive, {timeout: 2000})
29+
stats.network = networkSpeed(archive, { timeout: 2000 })
3030

3131
Object.defineProperties(stats, {
3232
peers: {
@@ -81,7 +81,7 @@ module.exports = function (archive) {
8181
// get current size of archive
8282
var current = archive.tree.checkout(archive.version)
8383
var initial = archive.tree.checkout(count.version)
84-
var stream = initial.diff(current, {dels: true, puts: true})
84+
var stream = initial.diff(current, { dels: true, puts: true })
8585
each(stream, ondata, function () {
8686
count.version = current.version
8787
stats.emit('update', count)

0 commit comments

Comments
 (0)