This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 61
61
"is-stream" : " ^2.0.0" ,
62
62
"iso-stream-http" : " ~0.1.2" ,
63
63
"iso-url" : " ~0.4.6" ,
64
+ "it-to-stream" : " ^0.1.1" ,
64
65
"iterable-ndjson" : " ^1.1.0" ,
65
66
"just-kebab-case" : " ^1.1.0" ,
66
67
"just-map-keys" : " ^1.1.0" ,
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
3
const toPull = require ( 'async-iterator-to-pull-stream' )
4
+ const toStream = require ( 'it-to-stream' )
4
5
5
6
exports . collectify = fn => async ( ...args ) => {
6
7
const items = [ ]
@@ -12,3 +13,7 @@ exports.pullify = {
12
13
source : fn => ( ...args ) => toPull ( fn ( ...args ) ) ,
13
14
transform : fn => ( ...args ) => toPull . transform ( source => fn ( source , ...args ) )
14
15
}
16
+
17
+ exports . streamify = {
18
+ transform : fn => ( ...args ) => toStream . transform ( source => fn ( source , ...args ) , { objectMode : true } )
19
+ }
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
3
const nodeify = require ( 'promise-nodeify' )
4
- const { collectify, pullify } = require ( '../lib/iterable' )
4
+ const { collectify, pullify, streamify } = require ( '../lib/iterable' )
5
5
6
6
function requireCommands ( ) {
7
7
return {
@@ -16,8 +16,10 @@ function requireCommands () {
16
16
return nodeify ( add ( input , options ) , callback )
17
17
}
18
18
} ,
19
- // TODO: convert
20
- addReadableStream : require ( '../files-regular/add-readable-stream' ) ,
19
+ addReadableStream : ( _ , config ) => {
20
+ const add = require ( '../add' ) ( config )
21
+ return streamify . transform ( add )
22
+ } ,
21
23
addPullStream : ( _ , config ) => {
22
24
const add = require ( '../add' ) ( config )
23
25
return pullify . transform ( add )
You can’t perform that action at this time.
0 commit comments