diff --git a/package.json b/package.json index c4795d93..522a216b 100644 --- a/package.json +++ b/package.json @@ -174,7 +174,7 @@ }, "devDependencies": { "@types/varint": "^6.0.0", - "aegir": "^37.9.1", + "aegir": "^38.1.0", "sinon": "^15.0.0", "util": "^0.12.3" }, diff --git a/src/codec.ts b/src/codec.ts index c8f3a5a4..9dc6634c 100644 --- a/src/codec.ts +++ b/src/codec.ts @@ -21,6 +21,7 @@ export function stringToStringTuples (str: string): string[][] { if (proto.size === 0) { tuples.push([part]) + // eslint-disable-next-line no-continue continue } @@ -33,7 +34,7 @@ export function stringToStringTuples (str: string): string[][] { if (proto.path === true) { tuples.push([ part, - // TODO: should we need to check each path part to see if it's a proto? + // should we need to check each path part to see if it's a proto? // This would allow for other protocols to be added after a unix path, // however it would have issues if the path had a protocol name in the path cleanPath(parts.slice(p).join('/')) @@ -139,6 +140,7 @@ export function bytesToTuples (buf: Uint8Array): Tuple[] { if (size === 0) { tuples.push([code]) i += n + // eslint-disable-next-line no-continue continue } diff --git a/src/convert.ts b/src/convert.ts index 49669a53..f7c83c49 100644 --- a/src/convert.ts +++ b/src/convert.ts @@ -175,7 +175,7 @@ function mb2bytes (mbstr: string): Uint8Array { const size = Uint8Array.from(varint.encode(mb.length)) return uint8ArrayConcat([size, mb], size.length + mb.length) } -function bytes2mb (buf: Uint8Array) { +function bytes2mb (buf: Uint8Array): string { const size = varint.decode(buf) const hash = buf.slice(varint.decode.bytes) diff --git a/src/index.ts b/src/index.ts index 11e98e44..59698a60 100644 --- a/src/index.ts +++ b/src/index.ts @@ -510,7 +510,7 @@ class DefaultMultiaddr implements Multiaddr { } } - toString () { + toString (): string { if (this.#string == null) { this.#string = codec.bytesToString(this.bytes) } @@ -518,7 +518,7 @@ class DefaultMultiaddr implements Multiaddr { return this.#string } - toJSON () { + toJSON (): string { return this.toString() } diff --git a/src/ip.ts b/src/ip.ts index f5586afd..4dc6034a 100644 --- a/src/ip.ts +++ b/src/ip.ts @@ -67,7 +67,7 @@ export const toBytes = function (ip: string): Uint8Array { } // Copied from https://github.com/indutny/node-ip/blob/master/lib/ip.js#L63 -export const toString = function (buf: Uint8Array, offset: number = 0, length?: number) { +export const toString = function (buf: Uint8Array, offset: number = 0, length?: number): string { offset = ~~offset length = length ?? (buf.length - offset)