File tree 5 files changed +21
-10
lines changed
5 files changed +21
-10
lines changed Original file line number Diff line number Diff line change 22
22
},
23
23
"type" : " module" ,
24
24
"types" : " ./dist/src/index.d.ts" ,
25
+ "typesVersions" : {
26
+ "*" : {
27
+ "*" : [
28
+ " *" ,
29
+ " dist/*" ,
30
+ " dist/src/*" ,
31
+ " dist/src/*/index"
32
+ ],
33
+ "src/*" : [
34
+ " *" ,
35
+ " dist/*" ,
36
+ " dist/src/*" ,
37
+ " dist/src/*/index"
38
+ ]
39
+ }
40
+ },
25
41
"files" : [
26
42
" src" ,
27
43
" dist/src" ,
31
47
"exports" : {
32
48
"." : {
33
49
"import" : " ./dist/src/index.js"
50
+ },
51
+ "./resolvers" : {
52
+ "import" : " ./dist/src/resolvers/index.js"
34
53
}
35
54
},
36
55
"eslintConfig" : {
Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ export function isValidBytes (buf: Uint8Array) {
205
205
}
206
206
207
207
export function cleanPath ( str : string ) {
208
- return '/' + str . trim ( ) . split ( '/' ) . filter ( ( /** @type { any } */ a ) => a ) . join ( '/' )
208
+ return '/' + str . trim ( ) . split ( '/' ) . filter ( ( a ) => a ) . join ( '/' )
209
209
}
210
210
211
211
export function ParseError ( str : string ) {
Original file line number Diff line number Diff line change @@ -67,7 +67,6 @@ export class Multiaddr {
67
67
Object . defineProperty ( this , symbol , { value : true } )
68
68
69
69
if ( addr instanceof Uint8Array ) {
70
- /** @type {Uint8Array } - The raw bytes representing this multiaddress */
71
70
this . bytes = codec . fromBytes ( addr )
72
71
} else if ( typeof addr === 'string' ) {
73
72
if ( addr . length > 0 && addr . charAt ( 0 ) !== '/' ) {
@@ -512,9 +511,6 @@ export class Multiaddr {
512
511
* Multiaddr.fromNodeAddress({address: '127.0.0.1', port: '4001'}, 'tcp')
513
512
* // <Multiaddr 047f000001060fa1 - /ip4/127.0.0.1/tcp/4001>
514
513
* ```
515
- *
516
- * @param {{family: 4 | 6, address: string, port: number} } addr
517
- * @param {string } transport
518
514
*/
519
515
static fromNodeAddress ( addr : NodeAddress , transport : string ) {
520
516
if ( addr == null ) {
Original file line number Diff line number Diff line change @@ -4,10 +4,6 @@ import type { Multiaddr } from '../index.js'
4
4
5
5
const { code : dnsaddrCode } = getProtocol ( 'dnsaddr' )
6
6
7
- /**
8
- * @typedef {import('..').Multiaddr } Multiaddr
9
- */
10
-
11
7
/**
12
8
* Resolver for dnsaddr addresses.
13
9
*/
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ describe('multiaddr resolve', () => {
91
91
92
92
expect ( resolvedMas ) . to . have . length ( dnsaddrStub2 . length )
93
93
94
- resolvedMas . forEach ( ( /** @type { Multiaddr } */ ma , /** @type { number } */ index ) => {
94
+ resolvedMas . forEach ( ( ma , index ) => {
95
95
const stubAddr = dnsaddrStub2 [ index ] [ 0 ] . split ( '=' ) [ 1 ]
96
96
97
97
expect ( ma . equals ( new Multiaddr ( stubAddr ) ) ) . to . equal ( true )
You can’t perform that action at this time.
0 commit comments