Skip to content

Commit 459b4ae

Browse files
authored
chore: update deps (#268)
Updates all deps to the latest versions Non-package.json changes are due to the change in aegir linting rules
1 parent b0d2174 commit 459b4ae

File tree

9 files changed

+33
-22
lines changed

9 files changed

+33
-22
lines changed

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@
4343
"homepage": "https://github.com/ipfs/js-ipfs-bitswap#readme",
4444
"devDependencies": {
4545
"@nodeutils/defaults-deep": "^1.1.0",
46-
"aegir": "^26.0.0",
46+
"aegir": "^28.1.0",
4747
"benchmark": "^2.1.4",
4848
"delay": "^4.3.0",
49-
"ipfs-repo": "^6.0.1",
50-
"ipfs-utils": "^3.0.0",
49+
"ipfs-repo": "^7.0.0",
50+
"ipfs-utils": "^4.0.0",
5151
"iso-random-stream": "^1.1.1",
5252
"it-all": "^1.0.2",
5353
"it-drain": "^1.0.1",
54-
"libp2p": "libp2p/js-libp2p#0.29.x",
54+
"libp2p": "^0.29.3",
5555
"libp2p-kad-dht": "^0.20.0",
5656
"libp2p-mplex": "^0.10.0",
5757
"libp2p-secio": "^0.13.0",
@@ -73,15 +73,15 @@
7373
},
7474
"dependencies": {
7575
"abort-controller": "^3.0.0",
76-
"any-signal": "^1.1.0",
76+
"any-signal": "^2.1.1",
7777
"bignumber.js": "^9.0.0",
7878
"cids": "^1.0.0",
7979
"debug": "^4.1.0",
80-
"ipld-block": "^0.10.0",
80+
"ipld-block": "^0.11.0",
8181
"it-length-prefixed": "^3.0.0",
8282
"it-pipe": "^1.1.0",
8383
"just-debounce-it": "^1.1.0",
84-
"libp2p-interfaces": "^0.4.1",
84+
"libp2p-interfaces": "^0.7.1",
8585
"moving-average": "^1.0.0",
8686
"multicodec": "^2.0.0",
8787
"multihashing-async": "^2.0.1",

src/decision-engine/req-queue.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ const SortedMap = require('../utils/sorted-map')
1111

1212
/**
1313
* @typedef {Object} TaskMerger
14-
* @property {function(task, tasksWithTopic)} hasNewInfo - given the existing
15-
* tasks with the same topic, does the task add some new information?
16-
* Used to decide whether to merge the task or ignore it.
17-
* @property {function(task, existingTask)} merge - merge the information from
18-
* the given task into the existing task (with the same topic)
14+
* @property {function(task, tasksWithTopic)} hasNewInfo - given the existing tasks with the same topic, does the task add some new information? Used to decide whether to merge the task or ignore it.
15+
* @property {function(task, existingTask)} merge - merge the information from the given task into the existing task (with the same topic)
1916
*/
2017

2118
/**
@@ -49,6 +46,7 @@ class RequestQueue {
4946

5047
/**
5148
* Push tasks onto the queue for the given peer
49+
*
5250
* @param {PeerId} peerId
5351
* @param {Task} tasks
5452
*/
@@ -69,6 +67,7 @@ class RequestQueue {
6967
* the total size is at least targetMinBytes.
7068
* This puts the popped tasks into the "active" state, meaning they are
7169
* actively being processed (and cannot be modified).
70+
*
7271
* @param {number} targetMinBytes - the minimum total size of tasks to pop
7372
* @returns {Object}
7473
*/
@@ -109,6 +108,7 @@ class RequestQueue {
109108

110109
/**
111110
* Remove the task with the given topic for the given peer.
111+
*
112112
* @param {string} topic
113113
* @param {PeerId} peerId
114114
*/
@@ -119,6 +119,7 @@ class RequestQueue {
119119

120120
/**
121121
* Called when the tasks for the given peer complete.
122+
*
122123
* @param {PeerId} peerId
123124
* @param {Task[]} tasks
124125
*/
@@ -158,6 +159,7 @@ class PeerTasks {
158159

159160
/**
160161
* Push tasks onto the queue.
162+
*
161163
* @param {Task[]} tasks
162164
*/
163165
pushTasks (tasks) {
@@ -214,6 +216,7 @@ class PeerTasks {
214216

215217
/**
216218
* Pop tasks off the queue such that the total size is at least targetMinBytes
219+
*
217220
* @param {number} targetMinBytes
218221
* @returns {Object}
219222
*/
@@ -243,6 +246,7 @@ class PeerTasks {
243246
/**
244247
* Called when a task completes.
245248
* Note: must be the same reference as returned from popTasks.
249+
*
246250
* @param {Task} task
247251
*/
248252
taskDone (task) {
@@ -254,6 +258,7 @@ class PeerTasks {
254258

255259
/**
256260
* Remove pending tasks with the given topic
261+
*
257262
* @param {string} topic
258263
*/
259264
remove (topic) {
@@ -262,6 +267,7 @@ class PeerTasks {
262267

263268
/**
264269
* No work to be done, this PeerTasks object can be freed.
270+
*
265271
* @returns {boolean}
266272
*/
267273
isIdle () {

src/decision-engine/task-merger.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const TaskMerger = {
44
/**
55
* Indicates whether the given task has newer information than the active
66
* tasks with the same topic
7+
*
78
* @param {Task} task
89
* @param {Task[]} tasksWithTopic
910
* @returns {boolean}
@@ -39,6 +40,7 @@ const TaskMerger = {
3940

4041
/**
4142
* Merge the information from the task into the existing pending task
43+
*
4244
* @param {Task} newTask
4345
* @param {Task} existingTask
4446
*/

src/network.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,12 @@ class Network {
6969

7070
/**
7171
* Handles both types of incoming bitswap messages
72+
*
7273
* @private
7374
* @param {object} param0
74-
* @param {string} param0.protocol The protocol the stream is running
75-
* @param {Stream} param0.stream A duplex iterable stream
76-
* @param {Connection} param0.connection A libp2p Connection
75+
* @param {string} param0.protocol - The protocol the stream is running
76+
* @param {Stream} param0.stream - A duplex iterable stream
77+
* @param {Connection} param0.connection - A libp2p Connection
7778
* @returns {void}
7879
*/
7980
async _onConnection ({ protocol, stream, connection }) {

src/notifications.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Notifications extends EventEmitter {
3131
* Signal the system that we received `block`.
3232
*
3333
* @param {Block} block
34-
* @return {void}
34+
* @returns {void}
3535
*/
3636
hasBlock (block) {
3737
const event = blockEvent(block.cid)

src/utils/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ const sortBy = (fn, list) => {
8383

8484
/**
8585
* Is equal for Maps of BitswapMessageEntry or Blocks
86+
*
8687
* @param {Map} a
8788
* @param {Map} b
8889
* @returns {boolean}

src/utils/sorted-map.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
class SortedMap extends Map {
77
/**
88
* @param {Array<k, v>} [entries]
9-
* @param {function(a, b)} [cmp] compares [k1, v1] to [k2, v2]
9+
* @param {function(a, b)} [cmp] - compares [k1, v1] to [k2, v2]
1010
*/
1111
constructor (entries, cmp) {
1212
super()

test/network/gen-bitswap-network.node.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ describe('gen Bitswap network', function () {
5555

5656
/**
5757
* @private
58-
* @param {Array<*>} nodes Array of Bitswap Network nodes
59-
* @param {number} blocksPerNode Number of blocks to exchange per node
58+
* @param {Array<*>} nodes - Array of Bitswap Network nodes
59+
* @param {number} blocksPerNode - Number of blocks to exchange per node
6060
*/
6161
async function exchangeBlocks (nodes, blocksPerNode = 10) {
6262
const blocks = await createBlocks(nodes.length * blocksPerNode)
@@ -88,8 +88,9 @@ async function exchangeBlocks (nodes, blocksPerNode = 10) {
8888

8989
/**
9090
* Resolves `num` blocks
91+
*
9192
* @private
92-
* @param {number} num The number of blocks to create
93+
* @param {number} num - The number of blocks to create
9394
* @returns {Promise<Block[]>}
9495
*/
9596
function createBlocks (num) {

test/utils/mocks.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ exports.applyNetwork = (bs, n) => {
150150

151151
/**
152152
* @private
153-
* @param {number} n The number of nodes in the network
154-
* @param {boolean} enableDHT Whether or not to run the dht
153+
* @param {number} n - The number of nodes in the network
154+
* @param {boolean} enableDHT - Whether or not to run the dht
155155
*/
156156
exports.genBitswapNetwork = async (n, enableDHT = false) => {
157157
const netArray = [] // bitswap, peerStore, libp2p, peerId, repo

0 commit comments

Comments
 (0)