Skip to content

Commit e5e5f57

Browse files
authored
fix: add return to toOptions (#223)
Adds return type that constrains family to 4 or 6
1 parent 8eb452a commit e5e5f57

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ export class Multiaddr {
116116
* // { family: 4, host: '127.0.0.1', transport: 'tcp', port: 4001 }
117117
* ```
118118
*/
119-
toOptions () {
119+
toOptions (): MultiaddrObject {
120120
const parsed = this.toString().split('/')
121121

122-
const opts = {
122+
const opts: MultiaddrObject = {
123123
family: parsed[1] === 'ip4' ? 4 : 6,
124124
host: parsed[2],
125125
transport: parsed[3],

0 commit comments

Comments
 (0)