File tree Expand file tree Collapse file tree 4 files changed +11
-15
lines changed Expand file tree Collapse file tree 4 files changed +11
-15
lines changed Original file line number Diff line number Diff line change 11language : node_js
22node_js :
3+ - ' 12'
34 - ' 10'
45 - ' 8'
Original file line number Diff line number Diff line change 4141 ],
4242 "dependencies" : {
4343 "from2" : " ^2.3.0" ,
44- "p-is-promise" : " ^2 .0.0"
44+ "p-is-promise" : " ^3 .0.0"
4545 },
4646 "devDependencies" : {
47- "ava" : " ^1 .4.1 " ,
47+ "ava" : " ^2 .4.0 " ,
4848 "get-stream" : " ^5.0.0" ,
4949 "p-event" : " ^4.1.0" ,
50- "tsd" : " ^0.7.2 " ,
51- "xo" : " ^0.24.0 "
50+ "tsd" : " ^0.9.0 " ,
51+ "xo" : " ^0.25.3 "
5252 }
5353}
Original file line number Diff line number Diff line change @@ -26,22 +26,17 @@ intoStream('unicorn').pipe(process.stdout);
2626
2727### intoStream(input)
2828
29- Type: ` Buffer ` ` TypedArray ` ` ArrayBuffer ` ` string ` ` Iterable<Buffer| string> ` ` Promise ` <br >
29+ Type: ` Buffer | TypedArray | ArrayBuffer | string | Iterable<Buffer | string> | Promise ` <br >
3030Returns: [ Readable stream] ( https://nodejs.org/api/stream.html#stream_class_stream_readable )
3131
3232Adheres to the requested chunk size, except for ` array ` where each element will be a chunk.
3333
3434### intoStream.object(input)
3535
36- Type: ` Object ` , ` Iterable<Object> ` ` Promise ` <br >
36+ Type: ` object | Iterable<object> | Promise` <br >
3737Returns: [ Readable object stream] ( https://nodejs.org/api/stream.html#stream_object_mode )
3838
3939
4040## Related
4141
4242- [ to-readable-stream] ( https://github.com/sindresorhus/to-readable-stream ) - Simpler version of this module
43-
44-
45- ## License
46-
47- MIT © [ Sindre Sorhus] ( https://sindresorhus.com )
Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ test('buffer', async t => {
2828test ( 'ArrayBuffer' , async t => {
2929 const f = Buffer . from ( fixture ) ;
3030 const view = new Uint8Array ( f . length ) ;
31- for ( let i = 0 ; i < f . length ; i ++ ) {
32- view [ i ] = f [ i ] ;
31+ for ( const [ i , element ] of f . entries ( ) ) {
32+ view [ i ] = element ;
3333 }
3434
3535 t . true ( ( await getStream . buffer ( intoStream ( view . buffer ) ) ) . equals ( f ) ) ;
@@ -38,8 +38,8 @@ test('ArrayBuffer', async t => {
3838test ( 'ArrayBuffer view' , async t => {
3939 const f = Buffer . from ( fixture ) ;
4040 const view = new Uint8Array ( f . length ) ;
41- for ( let i = 0 ; i < f . length ; i ++ ) {
42- view [ i ] = f [ i ] ;
41+ for ( const [ i , element ] of f . entries ( ) ) {
42+ view [ i ] = element ;
4343 }
4444
4545 t . true ( ( await getStream . buffer ( intoStream ( view ) ) ) . equals ( f ) ) ;
You can’t perform that action at this time.
0 commit comments