Skip to content

Commit

Permalink
fix: infer type after isMultiaddr call (#227)
Browse files Browse the repository at this point in the history
Give a hint to tsc that the value is a multiaddr.
  • Loading branch information
achingbrain authored Feb 22, 2022
1 parent dbc801a commit 0720e3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ export class Multiaddr {
/**
* Check if object is a CID instance
*/
static isMultiaddr (value: any) {
static isMultiaddr (value: any): value is Multiaddr {
return value instanceof Multiaddr ?? Boolean(value?.[symbol])
}

Expand Down

0 comments on commit 0720e3a

Please sign in to comment.