@libp2p/interface-compliance-tests 5.1.3 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/matchers.d.ts +6 -0
- package/dist/src/matchers.d.ts.map +1 -0
- package/dist/src/matchers.js +8 -0
- package/dist/src/matchers.js.map +1 -0
- package/package.json +6 -2
- package/src/matchers.ts +11 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import Sinon from 'sinon';
|
|
2
|
+
import type { PeerId } from '@libp2p/interface';
|
|
3
|
+
import type { Multiaddr } from '@multiformats/multiaddr';
|
|
4
|
+
export declare function matchPeerId(peerId: PeerId): Sinon.SinonMatcher;
|
|
5
|
+
export declare function matchMultiaddr(ma: Multiaddr): Sinon.SinonMatcher;
|
|
6
|
+
//# sourceMappingURL=matchers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matchers.d.ts","sourceRoot":"","sources":["../../src/matchers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,wBAAgB,WAAW,CAAE,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,YAAY,CAE/D;AAED,wBAAgB,cAAc,CAAE,EAAE,EAAE,SAAS,GAAG,KAAK,CAAC,YAAY,CAEjE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import Sinon from 'sinon';
|
|
2
|
+
export function matchPeerId(peerId) {
|
|
3
|
+
return Sinon.match(p => p.toString() === peerId.toString());
|
|
4
|
+
}
|
|
5
|
+
export function matchMultiaddr(ma) {
|
|
6
|
+
return Sinon.match(m => m.toString() === ma.toString());
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=matchers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matchers.js","sourceRoot":"","sources":["../../src/matchers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,UAAU,WAAW,CAAE,MAAc;IACzC,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAA;AAC7D,CAAC;AAED,MAAM,UAAU,cAAc,CAAE,EAAa;IAC3C,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAA;AACzD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/interface-compliance-tests",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "Compliance tests for JS libp2p interfaces",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/interface-compliance-tests#readme",
|
|
@@ -60,6 +60,10 @@
|
|
|
60
60
|
"types": "./dist/src/is-valid-tick.d.ts",
|
|
61
61
|
"import": "./dist/src/is-valid-tick.js"
|
|
62
62
|
},
|
|
63
|
+
"./matchers": {
|
|
64
|
+
"types": "./dist/src/matchers.d.ts",
|
|
65
|
+
"import": "./dist/src/matchers.js"
|
|
66
|
+
},
|
|
63
67
|
"./mocks": {
|
|
64
68
|
"types": "./dist/src/mocks/index.d.ts",
|
|
65
69
|
"import": "./dist/src/mocks/index.js"
|
|
@@ -114,7 +118,7 @@
|
|
|
114
118
|
"@libp2p/peer-collections": "^5.1.5",
|
|
115
119
|
"@libp2p/peer-id": "^4.0.5",
|
|
116
120
|
"@libp2p/peer-id-factory": "^4.0.5",
|
|
117
|
-
"@libp2p/utils": "^5.2.
|
|
121
|
+
"@libp2p/utils": "^5.2.3",
|
|
118
122
|
"@multiformats/multiaddr": "^12.1.10",
|
|
119
123
|
"abortable-iterator": "^5.0.1",
|
|
120
124
|
"aegir": "^42.0.0",
|
package/src/matchers.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Sinon from 'sinon'
|
|
2
|
+
import type { PeerId } from '@libp2p/interface'
|
|
3
|
+
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
4
|
+
|
|
5
|
+
export function matchPeerId (peerId: PeerId): Sinon.SinonMatcher {
|
|
6
|
+
return Sinon.match(p => p.toString() === peerId.toString())
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function matchMultiaddr (ma: Multiaddr): Sinon.SinonMatcher {
|
|
10
|
+
return Sinon.match(m => m.toString() === ma.toString())
|
|
11
|
+
}
|