diff --git a/package.json b/package.json index c2498ad8..a21e67d9 100644 --- a/package.json +++ b/package.json @@ -16,10 +16,6 @@ "multiaddr", "string" ], - "engines": { - "node": ">=18.0.0", - "npm": ">=8.6.0" - }, "type": "module", "types": "./dist/src/index.d.ts", "typesVersions": { @@ -61,6 +57,7 @@ "eslintConfig": { "extends": "ipfs", "parserOptions": { + "project": true, "sourceType": "module" } }, @@ -175,7 +172,7 @@ }, "devDependencies": { "@types/sinon": "^10.0.14", - "aegir": "^40.0.2", + "aegir": "^41.0.11", "sinon": "^17.0.0" }, "browser": { diff --git a/src/index.ts b/src/index.ts index 2936e934..ab0a591c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -109,7 +109,7 @@ export interface Multiaddr { * // '/ip4/127.0.0.1/tcp/4001' * ``` */ - toString: () => string + toString(): string /** * Returns Multiaddr as a JSON encoded object @@ -122,7 +122,7 @@ export interface Multiaddr { * // '/ip4/127.0.0.1/tcp/4001' * ``` */ - toJSON: () => string + toJSON(): string /** * Returns Multiaddr as a convinient options object to be used with net.createConnection @@ -135,7 +135,7 @@ export interface Multiaddr { * // { family: 4, host: '127.0.0.1', transport: 'tcp', port: 4001 } * ``` */ - toOptions: () => MultiaddrObject + toOptions(): MultiaddrObject /** * Returns the protocols the Multiaddr is defined with, as an array of objects, in @@ -152,7 +152,7 @@ export interface Multiaddr { * // { code: 6, size: 16, name: 'tcp' } ] * ``` */ - protos: () => Protocol[] + protos(): Protocol[] /** * Returns the codes of the protocols in left-to-right order. @@ -166,7 +166,7 @@ export interface Multiaddr { * // [ 4, 6 ] * ``` */ - protoCodes: () => number[] + protoCodes(): number[] /** * Returns the names of the protocols in left-to-right order. @@ -180,7 +180,7 @@ export interface Multiaddr { * // [ 'ip4', 'tcp' ] * ``` */ - protoNames: () => string[] + protoNames(): string[] /** * Returns a tuple of parts @@ -193,7 +193,7 @@ export interface Multiaddr { * // [ [ 4, ], [ 6, ] ] * ``` */ - tuples: () => Tuple[] + tuples(): Tuple[] /** * Returns a tuple of string/number parts @@ -208,7 +208,7 @@ export interface Multiaddr { * // [ [ 4, '127.0.0.1' ], [ 6, '4001' ] ] * ``` */ - stringTuples: () => StringTuple[] + stringTuples(): StringTuple[] /** * Encapsulates a Multiaddr in another Multiaddr @@ -232,7 +232,7 @@ export interface Multiaddr { * * @param {MultiaddrInput} addr - Multiaddr to add into this Multiaddr */ - encapsulate: (addr: MultiaddrInput) => Multiaddr + encapsulate(addr: MultiaddrInput): Multiaddr /** * Decapsulates a Multiaddr from another Multiaddr @@ -256,7 +256,7 @@ export interface Multiaddr { * * @param {Multiaddr | string} addr - Multiaddr to remove from this Multiaddr */ - decapsulate: (addr: Multiaddr | string) => Multiaddr + decapsulate(addr: Multiaddr | string): Multiaddr /** * A more reliable version of `decapsulate` if you are targeting a @@ -278,7 +278,7 @@ export interface Multiaddr { * // '/ip4/127.0.0.1/tcp/8080' * ``` */ - decapsulateCode: (code: number) => Multiaddr + decapsulateCode(code: number): Multiaddr /** * Extract the peerId if the multiaddr contains one @@ -294,7 +294,7 @@ export interface Multiaddr { * const peerId = mh1.getPeerId() * ``` */ - getPeerId: () => string | null + getPeerId(): string | null /** * Extract the path if the multiaddr contains one @@ -310,7 +310,7 @@ export interface Multiaddr { * const path = mh1.getPath() * ``` */ - getPath: () => string | null + getPath(): string | null /** * Checks if two Multiaddrs are the same @@ -332,7 +332,7 @@ export interface Multiaddr { * // false * ``` */ - equals: (addr: { bytes: Uint8Array }) => boolean + equals(addr: { bytes: Uint8Array }): boolean /** * Resolve multiaddr if containing resolvable hostname. @@ -351,7 +351,7 @@ export interface Multiaddr { * // ] * ``` */ - resolve: (options?: AbortOptions) => Promise + resolve(options?: AbortOptions): Promise /** * Gets a Multiaddrs node-friendly address object. Note that protocol information @@ -368,7 +368,7 @@ export interface Multiaddr { * // {family: 4, address: '127.0.0.1', port: 4001} * ``` */ - nodeAddress: () => NodeAddress + nodeAddress(): NodeAddress /** * Returns if a Multiaddr is a Thin Waist address or not. @@ -399,7 +399,7 @@ export interface Multiaddr { * // false * ``` */ - isThinWaistAddress: (addr?: Multiaddr) => boolean + isThinWaistAddress(addr?: Multiaddr): boolean } /** diff --git a/typedoc.json b/typedoc.json new file mode 100644 index 00000000..41f5560e --- /dev/null +++ b/typedoc.json @@ -0,0 +1,7 @@ +{ + "entryPoints": [ + "./src/index.ts", + "./src/convert.ts", + "./src/resolvers/index.ts" + ] +}