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

deps(dev): bump aegir from 37.12.1 to 38.1.7 #80

Merged
merged 3 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
node_modules
build
dist
.docs
.coverage
node_modules
package-lock.json
yarn.lock
.vscode
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/array-equals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/ip-port-to-multiaddr.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion src/multiaddr/is-loopback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/multiaddr/is-private.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
6 changes: 3 additions & 3 deletions src/stream-to-ma-conn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -80,11 +80,11 @@ export function streamToMaConnection (props: StreamProperties, options: StreamOp
}
}

async function close () {
async function close (): Promise<void> {
if (maConn.timeline.close == null) {
maConn.timeline.close = Date.now()
}
return await Promise.resolve()
await Promise.resolve()
}

return maConn
Expand Down
2 changes: 1 addition & 1 deletion test/stream-to-ma-conn.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Uint8ArrayList, Uint8ArrayList | Uint8Array>) {
function toMuxedStream (stream: Duplex<Uint8ArrayList, Uint8ArrayList | Uint8Array>): Stream {
const muxedStream: Stream = {
...stream,
close: () => {},
Expand Down