@@ -6,57 +6,42 @@ const { collectify, pullify, streamify } = require('../lib/converters')
6
6
7
7
module . exports = ( arg ) => {
8
8
const send = moduleConfig ( arg )
9
+ const add = require ( '../add' ) ( arg )
10
+ const addFromFs = require ( '../add-from-fs' ) ( arg )
11
+ const addFromURL = require ( '../add-from-url' ) ( arg )
9
12
10
13
return {
11
- add : ( _ , config ) => {
12
- const add = collectify ( require ( '../add' ) ( config ) )
13
- return ( input , options , callback ) => {
14
- if ( typeof options === 'function' ) {
15
- callback = options
16
- options = { }
17
- }
18
- return nodeify ( add ( input , options ) , callback )
14
+ add : ( input , options , callback ) => {
15
+ if ( typeof options === 'function' ) {
16
+ callback = options
17
+ options = { }
19
18
}
19
+ return nodeify ( collectify ( add ) ( input , options ) , callback )
20
20
} ,
21
- addReadableStream : ( _ , config ) => {
22
- const add = require ( '../add' ) ( config )
23
- return streamify . transform ( add )
24
- } ,
25
- addPullStream : ( _ , config ) => {
26
- const add = require ( '../add' ) ( config )
27
- return pullify . transform ( add )
28
- } ,
29
- addFromFs : ( _ , config ) => {
30
- const addFromFs = collectify ( require ( '../add-from-fs' ) ( config ) )
31
- return ( path , options , callback ) => {
32
- if ( typeof options === 'function' ) {
33
- callback = options
34
- options = { }
35
- }
36
- return nodeify ( addFromFs ( path , options ) , callback )
21
+ addReadableStream : streamify . transform ( add ) ,
22
+ addPullStream : pullify . transform ( add ) ,
23
+ addFromFs : ( path , options , callback ) => {
24
+ if ( typeof options === 'function' ) {
25
+ callback = options
26
+ options = { }
37
27
}
28
+ return nodeify ( collectify ( addFromFs ) ( path , options ) , callback )
38
29
} ,
39
- addFromURL : ( _ , config ) => {
40
- const addFromURL = collectify ( require ( '../add-from-url' ) ( config ) )
41
- return ( url , options , callback ) => {
42
- if ( typeof options === 'function' ) {
43
- callback = options
44
- options = { }
45
- }
46
- return nodeify ( addFromURL ( url , options ) , callback )
30
+ addFromURL : ( url , options , callback ) => {
31
+ if ( typeof options === 'function' ) {
32
+ callback = options
33
+ options = { }
47
34
}
35
+ return nodeify ( collectify ( addFromURL ) ( url , options ) , callback )
48
36
} ,
49
- addFromStream : ( _ , config ) => {
50
- const add = collectify ( require ( '../add' ) ( config ) )
51
- return ( input , options , callback ) => {
52
- if ( typeof options === 'function' ) {
53
- callback = options
54
- options = { }
55
- }
56
- return nodeify ( add ( input , options ) , callback )
37
+ addFromStream : ( input , options , callback ) => {
38
+ if ( typeof options === 'function' ) {
39
+ callback = options
40
+ options = { }
57
41
}
42
+ return nodeify ( collectify ( add ) ( input , options ) , callback )
58
43
} ,
59
- _addAsyncIterator : ( _ , config ) => require ( '../ add' ) ( config ) ,
44
+ _addAsyncIterator : add ,
60
45
cat : require ( '../files-regular/cat' ) ( send ) ,
61
46
catReadableStream : require ( '../files-regular/cat-readable-stream' ) ( send ) ,
62
47
catPullStream : require ( '../files-regular/cat-pull-stream' ) ( send ) ,
0 commit comments