Skip to content

Commit 8c67bce

Browse files
committed
fix: feedback
1 parent 6241509 commit 8c67bce

File tree

12 files changed

+18
-89
lines changed

12 files changed

+18
-89
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
"events": "^3.1.0",
5252
"hashlru": "^2.3.0",
5353
"ipfs-utils": "^1.0.0",
54-
"iso-random-stream": "^1.1.1",
5554
"it-all": "^1.0.1",
5655
"it-buffer": "^0.1.2",
5756
"it-handshake": "^1.0.1",
@@ -73,6 +72,7 @@
7372
"peer-id": "^0.13.4",
7473
"peer-info": "^0.17.0",
7574
"protons": "^1.0.1",
75+
"streaming-iterables": "^4.1.0",
7676
"retimer": "^2.0.0",
7777
"timeout-abort-controller": "^1.0.0",
7878
"xsalsa20": "^1.0.2"
@@ -107,7 +107,6 @@
107107
"p-times": "^2.1.0",
108108
"p-wait-for": "^3.1.0",
109109
"sinon": "^9.0.0",
110-
"streaming-iterables": "^4.1.0",
111110
"wrtc": "^0.4.1"
112111
},
113112
"contributors": [

src/connection-manager/latency-monitor.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
'use strict'
22

3+
/**
4+
* This code is based on `latency-monitor` (https://github.com/mlucool/latency-monitor) by `mlucool` (https://github.com/mlucool), available under Apache License 2.0 (https://github.com/mlucool/latency-monitor/blob/master/LICENSE)
5+
*/
6+
37
/* global window */
48
const globalThis = require('ipfs-utils/src/globalthis')
59
const EventEmitter = require('events')

src/connection-manager/visibility-change-emitter.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
/* global document */
2+
3+
/**
4+
* This code is based on `latency-monitor` (https://github.com/mlucool/latency-monitor) by `mlucool` (https://github.com/mlucool), available under Apache License 2.0 (https://github.com/mlucool/latency-monitor/blob/master/LICENSE)
5+
*/
26
'use strict'
37
const EventEmitter = require('events')
48

src/identify/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const debug = require('debug')
55
const pb = require('it-protocol-buffers')
66
const lp = require('it-length-prefixed')
77
const pipe = require('it-pipe')
8-
const { collect, take, consume } = require('../../src/utils')
8+
const { collect, take, consume } = require('streaming-iterables')
99

1010
const PeerInfo = require('peer-info')
1111
const PeerId = require('peer-id')

src/metrics/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const mergeOptions = require('merge-options')
44
const pipe = require('it-pipe')
5-
const { tap } = require('../utils')
5+
const { tap } = require('streaming-iterables')
66
const oldPeerLRU = require('./old-peers')
77
const { METRICS: defaultOptions } = require('../constants')
88
const Stats = require('./stats')

src/ping/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const errCode = require('err-code')
88
const crypto = require('libp2p-crypto')
99
const pipe = require('it-pipe')
1010
const { toBuffer } = require('it-buffer')
11-
const { collect, take } = require('../utils')
11+
const { collect, take } = require('streaming-iterables')
1212

1313
const { PROTOCOL, PING_LENGTH } = require('./constants')
1414

src/pnet/key-generator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
const randomBytes = require('iso-random-stream/src/random')
3+
const crypto = require('libp2p-crypto')
44
const KEY_LENGTH = 32
55

66
/**
@@ -9,7 +9,7 @@ const KEY_LENGTH = 32
99
* @returns {void}
1010
*/
1111
function generate (writer) {
12-
const psk = randomBytes(KEY_LENGTH).toString('hex')
12+
const psk = crypto.randomBytes(KEY_LENGTH).toString('hex')
1313
writer.write('/key/swarm/psk/1.0.0/\n/base16/\n' + psk)
1414
}
1515

src/utils.js

Lines changed: 0 additions & 78 deletions
This file was deleted.

test/dialing/relay.node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const { expect } = chai
99
const sinon = require('sinon')
1010

1111
const multiaddr = require('multiaddr')
12-
const { collect } = require('../../src/utils')
12+
const { collect } = require('streaming-iterables')
1313
const pipe = require('it-pipe')
1414
const AggregateError = require('aggregate-error')
1515
const { createPeerInfo } = require('../utils/creators/peer')

test/metrics/index.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const duplexPair = require('it-pair/duplex')
1212
const pipe = require('it-pipe')
1313
const concat = require('it-concat')
1414
const pushable = require('it-pushable')
15-
const { consume } = require('../../src/utils')
15+
const { consume } = require('streaming-iterables')
1616
const delay = require('delay')
1717

1818
const Metrics = require('../../src/metrics')

0 commit comments

Comments
 (0)