This repository was archived by the owner on Oct 19, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 9 files changed +25
-101
lines changed Expand file tree Collapse file tree 9 files changed +25
-101
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 37
37
" labs"
38
38
],
39
39
"engines" : {
40
- "node" : " >=4 .0.0" ,
41
- "npm" : " >=3 .0.0"
40
+ "node" : " >=10 .0.0" ,
41
+ "npm" : " >=6 .0.0"
42
42
},
43
43
"license" : " MIT" ,
44
44
"dependencies" : {
45
45
"interface-connection" : " ~0.3.2" ,
46
46
"async" : " ^2.6.0" ,
47
- "debug" : " ^3.1.0" ,
48
- "lodash.isfunction" : " ^3.0.9" ,
49
- "lodash.range" : " ^3.2.0" ,
47
+ "debug" : " ^4.1.0" ,
50
48
"once" : " ^1.4.0" ,
51
49
"pull-handshake" : " ^1.1.4" ,
52
50
"pull-length-prefixed" : " ^1.3.1" ,
55
53
"varint" : " ^5.0.0"
56
54
},
57
55
"devDependencies" : {
58
- "aegir" : " ^15.1.0 " ,
56
+ "aegir" : " ^18.0.3 " ,
59
57
"chai" : " ^4.1.2" ,
60
58
"dirty-chai" : " ^2.0.1" ,
61
59
"libp2p-multiplex" : " ~0.5.1" ,
62
- "libp2p-spdy" : " ~0.12 .1" ,
60
+ "libp2p-spdy" : " ~0.13 .1" ,
63
61
"pull-pair" : " ^1.1.0" ,
64
62
"pump" : " ^3.0.0" ,
65
63
"run-parallel" : " ^1.1.9" ,
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
3
const varint = require ( 'varint' )
4
- const pull = require ( 'pull-stream' )
4
+ const pull = require ( 'pull-stream/pull' )
5
+ const map = require ( 'pull-stream/throughs/map' )
6
+ const collect = require ( 'pull-stream/sinks/collect' )
7
+ const take = require ( 'pull-stream/throughs/take' )
5
8
const pullLP = require ( 'pull-length-prefixed' )
6
9
const Connection = require ( 'interface-connection' ) . Connection
7
10
const util = require ( '../util' )
@@ -113,8 +116,8 @@ class Dialer {
113
116
conn ,
114
117
pullLP . decode ( ) ,
115
118
collectLs ( conn ) ,
116
- pull . map ( stringify ) ,
117
- pull . collect ( ( err , list ) => {
119
+ map ( stringify ) ,
120
+ collect ( ( err , list ) => {
118
121
if ( err ) {
119
122
return callback ( err )
120
123
}
@@ -139,7 +142,7 @@ function collectLs (conn) {
139
142
let first = true
140
143
let counter = 0
141
144
142
- return pull . take ( ( msg ) => {
145
+ return take ( ( msg ) => {
143
146
if ( first ) {
144
147
varint . decode ( msg )
145
148
counter = varint . decode ( msg , varint . decode . bytes )
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
- const pull = require ( 'pull-stream' )
4
- const isFunction = require ( 'lodash.isfunction' )
3
+ const pull = require ( 'pull-stream/pull' )
5
4
const assert = require ( 'assert' )
6
5
const select = require ( '../select' )
7
6
const selectHandler = require ( './select-handler' )
@@ -77,7 +76,7 @@ class Listener {
77
76
*/
78
77
addHandler ( protocol , handlerFunc , matchFunc ) {
79
78
this . log ( 'adding handler: ' + protocol )
80
- assert ( isFunction ( handlerFunc ) , 'handler must be a function' )
79
+ assert ( typeof handlerFunc === 'function' , 'handler must be a function' )
81
80
82
81
if ( this . handlers [ protocol ] ) {
83
82
this . log ( 'overwriting handler for ' + protocol )
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
- const pull = require ( 'pull-stream' )
3
+ const pull = require ( 'pull-stream/pull' )
4
+ const values = require ( 'pull-stream/sources/values' )
4
5
const pullLP = require ( 'pull-length-prefixed' )
5
6
const varint = require ( 'varint' )
6
7
@@ -24,10 +25,9 @@ function lsHandler (self, conn) {
24
25
const encodedProtos = protos . map ( ( proto ) => {
25
26
return Buffer . from ( proto + '\n' )
26
27
} )
27
- const values = [ buf ] . concat ( encodedProtos )
28
28
29
29
pull (
30
- pull . values ( values ) ,
30
+ values ( [ buf ] . concat ( encodedProtos ) ) ,
31
31
pullLP . encode ( ) ,
32
32
conn
33
33
)
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
- const pull = require ( 'pull-stream' )
3
+ const pull = require ( 'pull-stream/pull' )
4
+ const values = require ( 'pull-stream/sources/values' )
5
+ const collect = require ( 'pull-stream/sinks/collect' )
4
6
const pullLP = require ( 'pull-length-prefixed' )
5
7
const debug = require ( 'debug' )
6
8
@@ -13,12 +15,10 @@ function randomId () {
13
15
// prefixes a message with a varint
14
16
// TODO this is a pull-stream 'creep' (pull stream to add a byte?')
15
17
function encode ( msg , callback ) {
16
- const values = Buffer . isBuffer ( msg ) ? [ msg ] : [ Buffer . from ( msg ) ]
17
-
18
18
pull (
19
- pull . values ( values ) ,
19
+ values ( Buffer . isBuffer ( msg ) ? [ msg ] : [ Buffer . from ( msg ) ] ) ,
20
20
pullLP . encode ( ) ,
21
- pull . collect ( ( err , encoded ) => {
21
+ collect ( ( err , encoded ) => {
22
22
if ( err ) {
23
23
return callback ( err )
24
24
}
Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ const util = require('./util')
17
17
const createPair = util . createPair
18
18
19
19
const options = [
20
- { name : 'over pull-pair' } ,
21
- { name : 'over spdy' , muxer : spdy } ,
22
- { name : 'over multiplex' , muxer : multiplex }
20
+ { name : 'over pull-pair' } ,
21
+ { name : 'over spdy' , muxer : spdy } ,
22
+ { name : 'over multiplex' , muxer : multiplex }
23
23
]
24
24
25
25
options . forEach ( ( option ) => {
You can’t perform that action at this time.
0 commit comments