From 2c262ba37d3668bc4f957914c40c5167cd8faf4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Mar 2023 12:54:21 +0100 Subject: [PATCH] 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](https://github.com/ipfs/aegir/compare/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] * chore: fix linting * chore: update project --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: achingbrain --- .gitignore | 3 +++ package.json | 3 +-- src/array-equals.ts | 4 ++-- src/ip-port-to-multiaddr.ts | 4 ++-- src/multiaddr/is-loopback.ts | 2 +- src/multiaddr/is-private.ts | 2 +- src/stream-to-ma-conn.ts | 6 +++--- test/stream-to-ma-conn.spec.ts | 2 +- 8 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 1531bdf9de..7ad9e674ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ node_modules +build dist .docs .coverage +node_modules package-lock.json yarn.lock +.vscode diff --git a/package.json b/package.json index b33e551b05..0a9b55e05d 100644 --- a/package.json +++ b/package.json @@ -189,10 +189,9 @@ "uint8arraylist": "^2.3.2" }, "devDependencies": { - "aegir": "^37.2.0", + "aegir": "^38.1.7", "it-all": "^2.0.0", "it-map": "^2.0.0", - "it-pair": "^2.0.2", "it-pipe": "^2.0.2", "p-defer": "^4.0.0", "uint8arrays": "^4.0.2" diff --git a/src/array-equals.ts b/src/array-equals.ts index 21db48875e..e94499acbb 100644 --- a/src/array-equals.ts +++ b/src/array-equals.ts @@ -21,8 +21,8 @@ * Verify if two arrays of non primitive types with the "equals" function are equal. * Compatible with multiaddr, peer-id and others. */ -export function arrayEquals (a: any[], b: any[]) { - const sort = (a: any, b: any) => a.toString().localeCompare(b.toString()) +export function arrayEquals (a: any[], b: any[]): boolean { + const sort = (a: any, b: any): number => a.toString().localeCompare(b.toString()) if (a.length !== b.length) { return false diff --git a/src/ip-port-to-multiaddr.ts b/src/ip-port-to-multiaddr.ts index 35144d0f7d..bb80dcb90e 100644 --- a/src/ip-port-to-multiaddr.ts +++ b/src/ip-port-to-multiaddr.ts @@ -1,5 +1,5 @@ import { logger } from '@libp2p/logger' -import { multiaddr } from '@multiformats/multiaddr' +import { Multiaddr, multiaddr } from '@multiformats/multiaddr' import { CodeError } from '@libp2p/interfaces/errors' import { Address4, Address6 } from '@achingbrain/ip-address' @@ -14,7 +14,7 @@ export const Errors = { /** * Transform an IP, Port pair into a multiaddr */ -export function ipPortToMultiaddr (ip: string, port: number | string) { +export function ipPortToMultiaddr (ip: string, port: number | string): Multiaddr { if (typeof ip !== 'string') { throw new CodeError(`invalid ip provided: ${ip}`, Errors.ERR_INVALID_IP_PARAMETER) // eslint-disable-line @typescript-eslint/restrict-template-expressions } diff --git a/src/multiaddr/is-loopback.ts b/src/multiaddr/is-loopback.ts index d676a66b4c..d66f545681 100644 --- a/src/multiaddr/is-loopback.ts +++ b/src/multiaddr/is-loopback.ts @@ -4,7 +4,7 @@ import type { Multiaddr } from '@multiformats/multiaddr' /** * Check if a given multiaddr is a loopback address. */ -export function isLoopback (ma: Multiaddr) { +export function isLoopback (ma: Multiaddr): boolean { const { address } = ma.nodeAddress() return isLoopbackAddr(address) diff --git a/src/multiaddr/is-private.ts b/src/multiaddr/is-private.ts index 54e8072ec4..4d8f416b75 100644 --- a/src/multiaddr/is-private.ts +++ b/src/multiaddr/is-private.ts @@ -4,7 +4,7 @@ import isIpPrivate from 'private-ip' /** * Check if a given multiaddr has a private address. */ -export function isPrivate (ma: Multiaddr) { +export function isPrivate (ma: Multiaddr): boolean { const { address } = ma.nodeAddress() return Boolean(isIpPrivate(address)) diff --git a/src/stream-to-ma-conn.ts b/src/stream-to-ma-conn.ts index 2eeb28d6ed..941f0a0327 100644 --- a/src/stream-to-ma-conn.ts +++ b/src/stream-to-ma-conn.ts @@ -39,7 +39,7 @@ export interface StreamProperties { * Convert a duplex iterable into a MultiaddrConnection. * https://github.com/libp2p/interface-transport#multiaddrconnection */ -export function streamToMaConnection (props: StreamProperties, options: StreamOptions = {}) { +export function streamToMaConnection (props: StreamProperties, options: StreamOptions = {}): MultiaddrConnection { const { stream, remoteAddr } = props const { sink, source } = stream @@ -80,11 +80,11 @@ export function streamToMaConnection (props: StreamProperties, options: StreamOp } } - async function close () { + async function close (): Promise { if (maConn.timeline.close == null) { maConn.timeline.close = Date.now() } - return await Promise.resolve() + await Promise.resolve() } return maConn diff --git a/test/stream-to-ma-conn.spec.ts b/test/stream-to-ma-conn.spec.ts index 0e9d52cf16..1997862c1a 100644 --- a/test/stream-to-ma-conn.spec.ts +++ b/test/stream-to-ma-conn.spec.ts @@ -11,7 +11,7 @@ import type { Stream } from '@libp2p/interface-connection' import type { Duplex } from 'it-stream-types' import type { Uint8ArrayList } from 'uint8arraylist' -function toMuxedStream (stream: Duplex) { +function toMuxedStream (stream: Duplex): Stream { const muxedStream: Stream = { ...stream, close: () => {},