Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit bb49cad

Browse files
committed
chore: ping component linting
1 parent 29c91a5 commit bb49cad

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/cli/commands/ping.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = {
2626
pull(
2727
argv.ipfs.pingPullStream(peerId, { count }),
2828
pullCatch(err => {
29-
throw err
29+
throw err
3030
}),
3131
drain(({ Time, Text }) => {
3232
// Check if it's a pong

src/core/components/ping.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ module.exports = function ping (self) {
4848
return source.end(err)
4949
}
5050

51-
let packetCount = 0
51+
let packetCount = 0
5252
let totalTime = 0
5353
source.push(getPacket({Success: true, Text: `PING ${peerId}`}))
5454

@@ -57,7 +57,7 @@ module.exports = function ping (self) {
5757
totalTime += time
5858
packetCount++
5959
if (packetCount >= count) {
60-
const average = totalTime/count
60+
const average = totalTime / count
6161
p.stop()
6262
source.push(getPacket({ Success: true, Text: `Average latency: ${average}ms` }))
6363
source.end()
@@ -73,7 +73,7 @@ module.exports = function ping (self) {
7373

7474
p.start()
7575
})
76-
76+
7777
cb(null, response)
7878
})
7979
}

src/http/api/resources/ping.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ exports.get = {
1313
query: Joi.object().keys({
1414
n: Joi.alternatives()
1515
.when('count', {
16-
is: true, then: Joi.any().forbidden(),
16+
is: true,
17+
then: Joi.any().forbidden(),
1718
otherwise: Joi.number().greater(0)
1819
}),
1920
count: Joi.number().greater(0),

0 commit comments

Comments
 (0)