@libp2p/interface-compliance-tests 5.1.0 → 5.1.1-821a38e24
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/mocks/metrics.js +4 -4
- package/package.json +10 -10
- package/src/mocks/metrics.ts +4 -4
- package/dist/typedoc-urls.json +0 -38
|
@@ -57,7 +57,7 @@ class MockMetrics {
|
|
|
57
57
|
trackProtocolStream(stream, connection) {
|
|
58
58
|
}
|
|
59
59
|
registerMetric(name, opts) {
|
|
60
|
-
if (name == null
|
|
60
|
+
if (name == null || name.trim() === '') {
|
|
61
61
|
throw new Error('Metric name is required');
|
|
62
62
|
}
|
|
63
63
|
if (opts?.calculate != null) {
|
|
@@ -70,7 +70,7 @@ class MockMetrics {
|
|
|
70
70
|
return metric;
|
|
71
71
|
}
|
|
72
72
|
registerCounter(name, opts) {
|
|
73
|
-
if (name == null
|
|
73
|
+
if (name == null || name.trim() === '') {
|
|
74
74
|
throw new Error('Metric name is required');
|
|
75
75
|
}
|
|
76
76
|
if (opts?.calculate != null) {
|
|
@@ -83,7 +83,7 @@ class MockMetrics {
|
|
|
83
83
|
return metric;
|
|
84
84
|
}
|
|
85
85
|
registerMetricGroup(name, opts) {
|
|
86
|
-
if (name == null
|
|
86
|
+
if (name == null || name.trim() === '') {
|
|
87
87
|
throw new Error('Metric name is required');
|
|
88
88
|
}
|
|
89
89
|
if (opts?.calculate != null) {
|
|
@@ -96,7 +96,7 @@ class MockMetrics {
|
|
|
96
96
|
return metric;
|
|
97
97
|
}
|
|
98
98
|
registerCounterGroup(name, opts) {
|
|
99
|
-
if (name == null
|
|
99
|
+
if (name == null || name.trim() === '') {
|
|
100
100
|
throw new Error('Metric name is required');
|
|
101
101
|
}
|
|
102
102
|
if (opts?.calculate != null) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/interface-compliance-tests",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.1-821a38e24",
|
|
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",
|
|
@@ -103,17 +103,17 @@
|
|
|
103
103
|
"test:electron-main": "aegir test -t electron-main"
|
|
104
104
|
},
|
|
105
105
|
"dependencies": {
|
|
106
|
-
"@libp2p/interface": "
|
|
107
|
-
"@libp2p/interface-internal": "
|
|
108
|
-
"@libp2p/logger": "
|
|
109
|
-
"@libp2p/multistream-select": "
|
|
110
|
-
"@libp2p/peer-collections": "
|
|
111
|
-
"@libp2p/peer-id": "
|
|
112
|
-
"@libp2p/peer-id-factory": "
|
|
113
|
-
"@libp2p/utils": "
|
|
106
|
+
"@libp2p/interface": "1.1.1-821a38e24",
|
|
107
|
+
"@libp2p/interface-internal": "1.0.5-821a38e24",
|
|
108
|
+
"@libp2p/logger": "4.0.4-821a38e24",
|
|
109
|
+
"@libp2p/multistream-select": "5.1.1-821a38e24",
|
|
110
|
+
"@libp2p/peer-collections": "5.1.3-821a38e24",
|
|
111
|
+
"@libp2p/peer-id": "4.0.4-821a38e24",
|
|
112
|
+
"@libp2p/peer-id-factory": "4.0.3-821a38e24",
|
|
113
|
+
"@libp2p/utils": "5.2.0-821a38e24",
|
|
114
114
|
"@multiformats/multiaddr": "^12.1.10",
|
|
115
115
|
"abortable-iterator": "^5.0.1",
|
|
116
|
-
"aegir": "^
|
|
116
|
+
"aegir": "^42.0.0",
|
|
117
117
|
"delay": "^6.0.0",
|
|
118
118
|
"it-all": "^3.0.2",
|
|
119
119
|
"it-drain": "^3.0.2",
|
package/src/mocks/metrics.ts
CHANGED
|
@@ -82,7 +82,7 @@ class MockMetrics implements Metrics {
|
|
|
82
82
|
registerMetric (name: string, opts: CalculatedMetricOptions): void
|
|
83
83
|
registerMetric (name: string, opts?: MetricOptions): Metric
|
|
84
84
|
registerMetric (name: string, opts: any): any {
|
|
85
|
-
if (name == null
|
|
85
|
+
if (name == null || name.trim() === '') {
|
|
86
86
|
throw new Error('Metric name is required')
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -101,7 +101,7 @@ class MockMetrics implements Metrics {
|
|
|
101
101
|
registerCounter (name: string, opts: CalculatedMetricOptions): void
|
|
102
102
|
registerCounter (name: string, opts?: MetricOptions): Metric
|
|
103
103
|
registerCounter (name: string, opts: any): any {
|
|
104
|
-
if (name == null
|
|
104
|
+
if (name == null || name.trim() === '') {
|
|
105
105
|
throw new Error('Metric name is required')
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -120,7 +120,7 @@ class MockMetrics implements Metrics {
|
|
|
120
120
|
registerMetricGroup (name: string, opts: CalculatedMetricOptions<Record<string, number>>): void
|
|
121
121
|
registerMetricGroup (name: string, opts?: MetricOptions): MetricGroup
|
|
122
122
|
registerMetricGroup (name: string, opts: any): any {
|
|
123
|
-
if (name == null
|
|
123
|
+
if (name == null || name.trim() === '') {
|
|
124
124
|
throw new Error('Metric name is required')
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -139,7 +139,7 @@ class MockMetrics implements Metrics {
|
|
|
139
139
|
registerCounterGroup (name: string, opts: CalculatedMetricOptions<Record<string, number>>): void
|
|
140
140
|
registerCounterGroup (name: string, opts?: MetricOptions): MetricGroup
|
|
141
141
|
registerCounterGroup (name: string, opts: any): any {
|
|
142
|
-
if (name == null
|
|
142
|
+
if (name == null || name.trim() === '') {
|
|
143
143
|
throw new Error('Metric name is required')
|
|
144
144
|
}
|
|
145
145
|
|
package/dist/typedoc-urls.json
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"default": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface_compliance_tests.connection.default.html",
|
|
3
|
-
"./connection:default": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface_compliance_tests.connection.default.html",
|
|
4
|
-
"./connection-encryption:default": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface_compliance_tests.connection_encryption.default.html",
|
|
5
|
-
"TestSetup": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_compliance_tests.index.TestSetup.html",
|
|
6
|
-
".:TestSetup": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_compliance_tests.index.TestSetup.html",
|
|
7
|
-
"isValidTick": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface_compliance_tests.is_valid_tick.isValidTick.html",
|
|
8
|
-
"./is-valid-tick:isValidTick": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface_compliance_tests.is_valid_tick.isValidTick.html",
|
|
9
|
-
"MockNetworkComponents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_compliance_tests.mocks.MockNetworkComponents.html",
|
|
10
|
-
"MockUpgraderInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_compliance_tests.mocks.MockUpgraderInit.html",
|
|
11
|
-
"mockNetwork": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface_compliance_tests.mocks.mockNetwork.html",
|
|
12
|
-
"connectionPair": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface_compliance_tests.mocks.connectionPair.html",
|
|
13
|
-
"mockConnection": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface_compliance_tests.mocks.mockConnection.html",
|
|
14
|
-
"mockConnectionGater": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface_compliance_tests.mocks.mockConnectionGater.html",
|
|
15
|
-
"mockConnectionManager": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface_compliance_tests.mocks.mockConnectionManager.html",
|
|
16
|
-
"mockDuplex": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface_compliance_tests.mocks.mockDuplex.html",
|
|
17
|
-
"mockMetrics": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface_compliance_tests.mocks.mockMetrics.html",
|
|
18
|
-
"mockMultiaddrConnPair": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface_compliance_tests.mocks.mockMultiaddrConnPair.html",
|
|
19
|
-
"mockMultiaddrConnection": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface_compliance_tests.mocks.mockMultiaddrConnection.html",
|
|
20
|
-
"mockMuxer": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface_compliance_tests.mocks.mockMuxer.html",
|
|
21
|
-
"mockRegistrar": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface_compliance_tests.mocks.mockRegistrar.html",
|
|
22
|
-
"mockStream": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface_compliance_tests.mocks.mockStream.html",
|
|
23
|
-
"mockUpgrader": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface_compliance_tests.mocks.mockUpgrader.html",
|
|
24
|
-
"streamPair": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface_compliance_tests.mocks.streamPair.html",
|
|
25
|
-
"./peer-discovery:default": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface_compliance_tests.peer_discovery.default.html",
|
|
26
|
-
"./peers:default": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface_compliance_tests.peers.default.html",
|
|
27
|
-
"PubSubArgs": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_compliance_tests.pubsub.PubSubArgs.html",
|
|
28
|
-
"./pubsub:PubSubArgs": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_compliance_tests.pubsub.PubSubArgs.html",
|
|
29
|
-
"PubSubComponents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_compliance_tests.pubsub.PubSubComponents.html",
|
|
30
|
-
"./pubsub:PubSubComponents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_compliance_tests.pubsub.PubSubComponents.html",
|
|
31
|
-
"./pubsub:default": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface_compliance_tests.pubsub.default.html",
|
|
32
|
-
"./stream-muxer:default": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface_compliance_tests.stream_muxer.default.html",
|
|
33
|
-
"Connector": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_compliance_tests.transport.Connector.html",
|
|
34
|
-
"./transport:Connector": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_compliance_tests.transport.Connector.html",
|
|
35
|
-
"TransportTestFixtures": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_compliance_tests.transport.TransportTestFixtures.html",
|
|
36
|
-
"./transport:TransportTestFixtures": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_compliance_tests.transport.TransportTestFixtures.html",
|
|
37
|
-
"./transport:default": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface_compliance_tests.transport.default.html"
|
|
38
|
-
}
|