Skip to content
This repository was archived by the owner on Jul 21, 2023. It is now read-only.

Commit 2c262ba

Browse files
deps(dev): bump aegir from 37.12.1 to 38.1.7 (#80)
* deps(dev): bump aegir from 37.12.1 to 38.1.7 Bumps [aegir](https://github.com/ipfs/aegir) from 37.12.1 to 38.1.7. - [Release notes](https://github.com/ipfs/aegir/releases) - [Changelog](https://github.com/ipfs/aegir/blob/master/CHANGELOG.md) - [Commits](ipfs/aegir@v37.12.1...v38.1.7) --- updated-dependencies: - dependency-name: aegir dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * chore: fix linting * chore: update project --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: achingbrain <[email protected]>
1 parent de1c3d8 commit 2c262ba

8 files changed

+14
-12
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
node_modules
2+
build
23
dist
34
.docs
45
.coverage
6+
node_modules
57
package-lock.json
68
yarn.lock
9+
.vscode

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,9 @@
189189
"uint8arraylist": "^2.3.2"
190190
},
191191
"devDependencies": {
192-
"aegir": "^37.2.0",
192+
"aegir": "^38.1.7",
193193
"it-all": "^2.0.0",
194194
"it-map": "^2.0.0",
195-
"it-pair": "^2.0.2",
196195
"it-pipe": "^2.0.2",
197196
"p-defer": "^4.0.0",
198197
"uint8arrays": "^4.0.2"

src/array-equals.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
* Verify if two arrays of non primitive types with the "equals" function are equal.
2222
* Compatible with multiaddr, peer-id and others.
2323
*/
24-
export function arrayEquals (a: any[], b: any[]) {
25-
const sort = (a: any, b: any) => a.toString().localeCompare(b.toString())
24+
export function arrayEquals (a: any[], b: any[]): boolean {
25+
const sort = (a: any, b: any): number => a.toString().localeCompare(b.toString())
2626

2727
if (a.length !== b.length) {
2828
return false

src/ip-port-to-multiaddr.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { logger } from '@libp2p/logger'
2-
import { multiaddr } from '@multiformats/multiaddr'
2+
import { Multiaddr, multiaddr } from '@multiformats/multiaddr'
33
import { CodeError } from '@libp2p/interfaces/errors'
44
import { Address4, Address6 } from '@achingbrain/ip-address'
55

@@ -14,7 +14,7 @@ export const Errors = {
1414
/**
1515
* Transform an IP, Port pair into a multiaddr
1616
*/
17-
export function ipPortToMultiaddr (ip: string, port: number | string) {
17+
export function ipPortToMultiaddr (ip: string, port: number | string): Multiaddr {
1818
if (typeof ip !== 'string') {
1919
throw new CodeError(`invalid ip provided: ${ip}`, Errors.ERR_INVALID_IP_PARAMETER) // eslint-disable-line @typescript-eslint/restrict-template-expressions
2020
}

src/multiaddr/is-loopback.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { Multiaddr } from '@multiformats/multiaddr'
44
/**
55
* Check if a given multiaddr is a loopback address.
66
*/
7-
export function isLoopback (ma: Multiaddr) {
7+
export function isLoopback (ma: Multiaddr): boolean {
88
const { address } = ma.nodeAddress()
99

1010
return isLoopbackAddr(address)

src/multiaddr/is-private.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import isIpPrivate from 'private-ip'
44
/**
55
* Check if a given multiaddr has a private address.
66
*/
7-
export function isPrivate (ma: Multiaddr) {
7+
export function isPrivate (ma: Multiaddr): boolean {
88
const { address } = ma.nodeAddress()
99

1010
return Boolean(isIpPrivate(address))

src/stream-to-ma-conn.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export interface StreamProperties {
3939
* Convert a duplex iterable into a MultiaddrConnection.
4040
* https://github.com/libp2p/interface-transport#multiaddrconnection
4141
*/
42-
export function streamToMaConnection (props: StreamProperties, options: StreamOptions = {}) {
42+
export function streamToMaConnection (props: StreamProperties, options: StreamOptions = {}): MultiaddrConnection {
4343
const { stream, remoteAddr } = props
4444
const { sink, source } = stream
4545

@@ -80,11 +80,11 @@ export function streamToMaConnection (props: StreamProperties, options: StreamOp
8080
}
8181
}
8282

83-
async function close () {
83+
async function close (): Promise<void> {
8484
if (maConn.timeline.close == null) {
8585
maConn.timeline.close = Date.now()
8686
}
87-
return await Promise.resolve()
87+
await Promise.resolve()
8888
}
8989

9090
return maConn

test/stream-to-ma-conn.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import type { Stream } from '@libp2p/interface-connection'
1111
import type { Duplex } from 'it-stream-types'
1212
import type { Uint8ArrayList } from 'uint8arraylist'
1313

14-
function toMuxedStream (stream: Duplex<Uint8ArrayList, Uint8ArrayList | Uint8Array>) {
14+
function toMuxedStream (stream: Duplex<Uint8ArrayList, Uint8ArrayList | Uint8Array>): Stream {
1515
const muxedStream: Stream = {
1616
...stream,
1717
close: () => {},

0 commit comments

Comments
 (0)