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

Commit 9581ce0

Browse files
committed
refactor: add add/cat/get sub-modules.(#544)
1 parent f061df9 commit 9581ce0

File tree

8 files changed

+81
-24
lines changed

8 files changed

+81
-24
lines changed
Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
name - bundled - minified
2-
IPFS - 1684,11 - 661,26
3-
bitswap - 683,51 - 231,75
4-
block - 723,48 - 249,85
5-
bootstrap - 684,34 - 232,01
6-
commands - 682,59 - 231,38
7-
config - 685,58 - 232,72
8-
dht - 687,22 - 233,03
9-
diag - 683,67 - 231,80
10-
files - 1119,09 - 403,92
11-
id - 683,01 - 231,57
12-
key - 683,29 - 231,65
13-
log - 684,11 - 232,00
14-
ls - 682,71 - 231,42
15-
mount - 682,89 - 231,49
16-
name - 683,33 - 231,68
17-
object - 922,37 - 340,19
18-
pin - 684,22 - 232,01
19-
ping - 683,30 - 231,52
20-
pubsub - 739,11 - 249,16
21-
refs - 683,10 - 231,57
22-
repo - 683,27 - 231,64
23-
swarm - 1322,89 - 526,65
24-
update - 683,16 - 231,58
25-
version - 682,92 - 231,51
2+
IPFS - 1685.41 - 661.64
3+
add - 968.11 - 344.13
4+
bitswap - 684.80 - 232.13
5+
block - 724.77 - 250.23
6+
bootstrap - 685.64 - 232.39
7+
cat - 725.05 - 250.33
8+
commands - 683.89 - 231.76
9+
config - 686.87 - 233.10
10+
dht - 688.51 - 233.41
11+
diag - 684.97 - 232.18
12+
files - 1120.38 - 404.30
13+
get - 907.74 - 318.35
14+
id - 684.31 - 231.95
15+
key - 684.59 - 232.03
16+
log - 685.40 - 232.38
17+
ls - 684.00 - 231.80
18+
mount - 684.18 - 231.86
19+
name - 684.63 - 232.06
20+
object - 923.66 - 340.57
21+
pin - 685.51 - 232.39
22+
ping - 684.59 - 231.90
23+
pubsub - 740.40 - 249.54
24+
refs - 684.39 - 231.94
25+
repo - 684.56 - 232.02
26+
swarm - 1324.18 - 527.03
27+
update - 684.45 - 231.96
28+
version - 684.21 - 231.88
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
'use strict'
2+
3+
const add = require('../../../../src/add')('/ip4/127.0.0.1/tcp/5001')
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
'use strict'
2+
3+
const cat = require('../../../../src/cat')('/ip4/127.0.0.1/tcp/5001')
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
'use strict'
2+
3+
const get = require('../../../../src/get')('/ip4/127.0.0.1/tcp/5001')

src/add.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict'
2+
3+
const moduleConfig = require('./utils/module-config')
4+
5+
module.exports = (arg) => {
6+
const send = moduleConfig(arg)
7+
8+
return require('./files/add')(send)
9+
}

src/cat.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict'
2+
3+
const moduleConfig = require('./utils/module-config')
4+
5+
module.exports = (arg) => {
6+
const send = moduleConfig(arg)
7+
8+
return require('./files/cat')(send)
9+
}

src/get.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict'
2+
3+
const moduleConfig = require('./utils/module-config')
4+
5+
module.exports = (arg) => {
6+
const send = moduleConfig(arg)
7+
8+
return require('./files/get')(send)
9+
}

test/sub-modules.spec.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,22 @@ describe('submodules', () => {
206206
expect(refs).to.be.a('function')
207207
expect(refs.local).to.be.a('function')
208208
})
209+
210+
it('add', () => {
211+
const add = require('../src/add')(config)
212+
213+
expect(add).to.be.a('function')
214+
})
215+
216+
it('get', () => {
217+
const get = require('../src/get')(config)
218+
219+
expect(get).to.be.a('function')
220+
})
221+
222+
it('cat', () => {
223+
const cat = require('../src/cat')(config)
224+
225+
expect(cat).to.be.a('function')
226+
})
209227
})

0 commit comments

Comments
 (0)