Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 8018eb4

Browse files
committed
chore: update deps
1 parent c21e032 commit 8018eb4

28 files changed

+48
-49
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
},
3939
"homepage": "https://github.com/ipfs/js-ipfs-mfs#readme",
4040
"devDependencies": {
41-
"aegir": "^18.0.2",
41+
"aegir": "^20.0.0",
4242
"async-iterator-all": "^1.0.0",
4343
"chai": "^4.2.0",
4444
"detect-node": "^2.0.4",
@@ -48,21 +48,21 @@
4848
"ipfs-repo": "~0.27.0",
4949
"ipld": "~0.25.0",
5050
"memdown": "^4.0.0",
51-
"temp-write": "^3.4.0"
51+
"temp-write": "^4.0.0"
5252
},
5353
"dependencies": {
5454
"@hapi/boom": "^7.4.2",
5555
"@hapi/joi": "^15.1.0",
5656
"async-iterator-last": "^1.0.0",
5757
"cids": "~0.7.1",
5858
"debug": "^4.1.0",
59-
"err-code": "^1.1.2",
59+
"err-code": "^2.0.0",
6060
"hamt-sharding": "~0.0.2",
6161
"interface-datastore": "~0.7.0",
6262
"ipfs-multipart": "~0.1.0",
6363
"ipfs-unixfs": "~0.1.16",
64-
"ipfs-unixfs-exporter": "~0.37.6",
65-
"ipfs-unixfs-importer": "~0.39.9",
64+
"ipfs-unixfs-exporter": "~0.38.0",
65+
"ipfs-unixfs-importer": "~0.40.0",
6666
"ipld-dag-pb": "~0.18.0",
6767
"joi-browser": "^13.4.0",
6868
"mortice": "^1.2.1",

src/cli/cp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module.exports = {
3737
},
3838

3939
handler (argv) {
40-
let {
40+
const {
4141
source,
4242
dest,
4343
getIpfs,

src/cli/flush.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = {
1212
builder: {},
1313

1414
handler (argv) {
15-
let {
15+
const {
1616
path,
1717
getIpfs
1818
} = argv

src/cli/ls.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports = {
3838
},
3939

4040
handler (argv) {
41-
let {
41+
const {
4242
path,
4343
getIpfs,
4444
long,

src/cli/mkdir.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module.exports = {
4242
},
4343

4444
handler (argv) {
45-
let {
45+
const {
4646
path,
4747
getIpfs,
4848
parents,

src/cli/mv.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = {
3232
},
3333

3434
handler (argv) {
35-
let {
35+
const {
3636
source,
3737
dest,
3838
getIpfs,

src/cli/read.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = {
2626
},
2727

2828
handler (argv) {
29-
let {
29+
const {
3030
path,
3131
getIpfs,
3232
offset,

src/cli/rm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = {
2020
},
2121

2222
handler (argv) {
23-
let {
23+
const {
2424
path,
2525
getIpfs,
2626
recursive

src/cli/stat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Type: <type>`,
4949
},
5050

5151
handler (argv) {
52-
let {
52+
const {
5353
path,
5454
getIpfs,
5555
format,

src/cli/write.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ module.exports = {
8787
},
8888

8989
handler (argv) {
90-
let {
90+
const {
9191
path,
9292
getIpfs,
9393
offset,

src/core/mkdir.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ module.exports = (context) => {
5353
throw errCode(new Error("path cannot have the prefix 'ipfs'"), 'ERR_INVALID_PATH')
5454
}
5555

56-
let root = await withMfsRoot(context)
56+
const root = await withMfsRoot(context)
5757
let parent
58-
let trail = []
58+
const trail = []
5959
const emptyDir = await createNode(context, 'directory', options)
6060

6161
// make sure the containing folder exists, creating it if necessary

src/core/stat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = (context) => {
2222
mfsPath
2323
} = await toMfsPath(context, path)
2424

25-
let exportPath = type === 'ipfs' && cid ? cid : mfsPath
25+
const exportPath = type === 'ipfs' && cid ? cid : mfsPath
2626
let file
2727

2828
try {

src/core/utils/add-link.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict'
22

33
const {
4-
DAGNode,
54
DAGLink
65
} = require('ipld-dag-pb')
76
const CID = require('cids')
@@ -157,11 +156,11 @@ const addFileToShardedDirectory = async (context, options) => {
157156
let index = 0
158157

159158
while (index < path.length) {
160-
let segment = path[index]
159+
const segment = path[index]
161160
index++
162-
let node = segment.node
161+
const node = segment.node
163162

164-
let link = node.Links
163+
const link = node.Links
165164
.find(link => link.Name.substring(0, 2) === segment.prefix)
166165

167166
if (!link) {
@@ -230,7 +229,7 @@ const addFileToShardedDirectory = async (context, options) => {
230229
const toBucketPath = (position) => {
231230
let bucket = position.bucket
232231
let positionInBucket = position.pos
233-
let path = [{
232+
const path = [{
234233
bucket,
235234
prefix: toPrefix(positionInBucket)
236235
}]

src/core/utils/apply-default-options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = (options = {}, defaults) => {
99

1010
const output = {}
1111

12-
for (let key in defaults) {
12+
for (const key in defaults) {
1313
if (options[key] !== null && options[key] !== undefined) {
1414
output[key] = options[key]
1515
} else {

src/core/utils/hamt-utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const generatePath = async (context, fileName, rootNode) => {
8585
const position = await rootBucket._findNewBucketAndPos(fileName)
8686

8787
// the path to the root bucket
88-
let path = [{
88+
const path = [{
8989
bucket: position.bucket,
9090
prefix: toPrefix(position.pos)
9191
}]

src/core/utils/remove-link.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ const updateShard = async (context, positions, child, options) => {
134134
return updateShardParent(context, bucket, node, prefix, newName, size, result.cid, options)
135135
}
136136

137-
const updateShardParent = async (context, bucket, parent, oldName, newName, size, cid, options) => {
137+
const updateShardParent = (context, bucket, parent, oldName, newName, size, cid, options) => {
138138
parent.rmLink(oldName)
139139
parent.addLink(new DAGLink(newName, size, cid))
140140

src/core/utils/to-async-iterator.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const {
77
MAX_CHUNK_SIZE
88
} = require('./constants')
99

10-
const toAsyncIterator = async (content) => {
10+
const toAsyncIterator = (content) => {
1111
if (!content) {
1212
throw errCode(new Error('paths must start with a leading /'), 'ERR_INVALID_PATH')
1313
}
@@ -23,7 +23,7 @@ const toAsyncIterator = async (content) => {
2323
log('Content was array-like')
2424

2525
return {
26-
[Symbol.asyncIterator]: async function * bufferContent () {
26+
[Symbol.asyncIterator]: function * bufferContent () {
2727
yield content
2828
}
2929
}
@@ -46,7 +46,7 @@ const toAsyncIterator = async (content) => {
4646
let index = 0
4747

4848
const iterator = {
49-
next: async () => {
49+
next: () => {
5050
if (index > content.size) {
5151
return {
5252
done: true

src/core/utils/to-mfs-path.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const errCode = require('err-code')
1111
const IPFS_PREFIX = 'ipfs'
1212

1313
const toMfsPath = async (context, path) => {
14-
let outputArray = Array.isArray(path)
14+
const outputArray = Array.isArray(path)
1515
let paths = Array.isArray(path) ? path : [path]
1616
const root = await loadMfsRoot(context)
1717

src/core/write.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ const write = async (context, source, destination, options) => {
174174
}
175175
})
176176

177-
let result = await last(importer([{
177+
const result = await last(importer([{
178178
content: content
179179
}], context.ipld, {
180180
progress: options.progress,
@@ -216,7 +216,7 @@ const asyncZeroes = (count, chunkSize = MAX_CHUNK_SIZE) => {
216216
const buf = Buffer.alloc(chunkSize, 0)
217217

218218
const stream = {
219-
[Symbol.asyncIterator]: async function * _asyncZeroes () {
219+
[Symbol.asyncIterator]: function * _asyncZeroes () {
220220
while (true) {
221221
yield buf.slice()
222222
}

test/cp.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ describe('cp', () => {
9090
it('copies a file to new location', async () => {
9191
const source = `/source-file-${Math.random()}.txt`
9292
const destination = `/dest-file-${Math.random()}.txt`
93-
let data = crypto.randomBytes(500)
93+
const data = crypto.randomBytes(500)
9494

9595
await mfs.write(source, data, {
9696
create: true
9797
})
9898

9999
await mfs.cp(source, destination)
100100

101-
let buffer = await streamToBuffer(mfs.read(destination))
101+
const buffer = await streamToBuffer(mfs.read(destination))
102102

103103
expect(buffer).to.deep.equal(data)
104104
})

test/helpers/create-mfs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const Repo = require('ipfs-repo')
1010
const BlockService = require('ipfs-block-service')
1111

1212
const createMfs = async () => {
13-
let repo = new Repo(`test-repo-${Date.now()}`, {
13+
const repo = new Repo(`test-repo-${Date.now()}`, {
1414
lock: 'memory',
1515
storageBackends: {
1616
root: MemoryDatastore,

test/helpers/create-shard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const importer = require('ipfs-unixfs-importer')
44
const last = require('async-iterator-last')
55

66
const createShard = async (ipld, files, shardSplitThreshold = 10) => {
7-
let result = await last(importer(files, ipld, {
7+
const result = await last(importer(files, ipld, {
88
shardSplitThreshold,
99
reduceSingleLeafToSelf: false, // same as go-ipfs-mfs implementation, differs from `ipfs add`(!)
1010
leafType: 'raw' // same as go-ipfs-mfs implementation, differs from `ipfs add`(!)

test/helpers/find-tree-with-depth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const findTreeWithDepth = async (ipld, children, depth) => {
2222
}
2323
}
2424

25-
const load = async (ipld, cid) => {
25+
const load = (ipld, cid) => {
2626
return new Promise((resolve, reject) => {
2727
ipld.get(cid, (err, res) => {
2828
if (err) {

test/ls.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const crypto = require('crypto')
1515

1616
describe('ls', () => {
1717
let mfs
18-
let largeFile = crypto.randomBytes(490668)
18+
const largeFile = crypto.randomBytes(490668)
1919

2020
before(async () => {
2121
mfs = await createMfs()

test/mv.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe('mv', () => {
3737
it('moves a file', async () => {
3838
const source = `/source-file-${Math.random()}.txt`
3939
const destination = `/dest-file-${Math.random()}.txt`
40-
let data = crypto.randomBytes(500)
40+
const data = crypto.randomBytes(500)
4141

4242
await mfs.write(source, data, {
4343
create: true

test/read.spec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const streamToBuffer = require('./helpers/stream-to-buffer')
1111

1212
describe('read', () => {
1313
let mfs
14-
let smallFile = crypto.randomBytes(13)
14+
const smallFile = crypto.randomBytes(13)
1515

1616
before(async () => {
1717
mfs = await createMfs()
@@ -32,7 +32,7 @@ describe('read', () => {
3232

3333
it('reads a file with an offset', async () => {
3434
const path = `/some-file-${Math.random()}.txt`
35-
let data = crypto.randomBytes(100)
35+
const data = crypto.randomBytes(100)
3636
const offset = 10
3737

3838
await mfs.write(path, data, {
@@ -48,7 +48,7 @@ describe('read', () => {
4848

4949
it('reads a file with a length', async () => {
5050
const path = `/some-file-${Math.random()}.txt`
51-
let data = crypto.randomBytes(100)
51+
const data = crypto.randomBytes(100)
5252
const length = 10
5353

5454
await mfs.write(path, data, {
@@ -64,7 +64,7 @@ describe('read', () => {
6464

6565
it('reads a file with a legacy count argument', async () => {
6666
const path = `/some-file-${Math.random()}.txt`
67-
let data = crypto.randomBytes(100)
67+
const data = crypto.randomBytes(100)
6868
const length = 10
6969

7070
await mfs.write(path, data, {
@@ -80,7 +80,7 @@ describe('read', () => {
8080

8181
it('reads a file with an offset and a length', async () => {
8282
const path = `/some-file-${Math.random()}.txt`
83-
let data = crypto.randomBytes(100)
83+
const data = crypto.randomBytes(100)
8484
const offset = 10
8585
const length = 10
8686

@@ -98,7 +98,7 @@ describe('read', () => {
9898

9999
it('reads a file with an offset and a legacy count argument', async () => {
100100
const path = `/some-file-${Math.random()}.txt`
101-
let data = crypto.randomBytes(100)
101+
const data = crypto.randomBytes(100)
102102
const offset = 10
103103
const length = 10
104104

test/stat.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const mc = require('multicodec')
1111

1212
describe('stat', () => {
1313
let mfs
14-
let smallFile = crypto.randomBytes(13)
15-
let largeFile = crypto.randomBytes(490668)
14+
const smallFile = crypto.randomBytes(13)
15+
const largeFile = crypto.randomBytes(490668)
1616

1717
before(async () => {
1818
mfs = await createMfs()

test/write.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ if (isNode) {
2525

2626
describe('write', () => {
2727
let mfs
28-
let smallFile = crypto.randomBytes(13)
29-
let largeFile = crypto.randomBytes(490668)
28+
const smallFile = crypto.randomBytes(13)
29+
const largeFile = crypto.randomBytes(490668)
3030

3131
const runTest = (fn) => {
3232
const iterations = 5
@@ -44,7 +44,7 @@ describe('write', () => {
4444
type: 'Really large file',
4545
path: `/really-large-file-${Math.random()}.jpg`,
4646
content: {
47-
[Symbol.asyncIterator]: async function * () {
47+
[Symbol.asyncIterator]: function * () {
4848
for (let i = 0; i < iterations; i++) {
4949
yield largeFile
5050
}

0 commit comments

Comments
 (0)