@libp2p/interface-compliance-tests 5.1.0 → 5.1.1

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.
@@ -57,7 +57,7 @@ class MockMetrics {
57
57
  trackProtocolStream(stream, connection) {
58
58
  }
59
59
  registerMetric(name, opts) {
60
- if (name == null ?? name.trim() === '') {
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 ?? name.trim() === '') {
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 ?? name.trim() === '') {
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 ?? name.trim() === '') {
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.0",
3
+ "version": "5.1.1",
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": "^1.1.0",
107
- "@libp2p/interface-internal": "^1.0.4",
108
- "@libp2p/logger": "^4.0.3",
109
- "@libp2p/multistream-select": "^5.1.0",
110
- "@libp2p/peer-collections": "^5.1.2",
111
- "@libp2p/peer-id": "^4.0.3",
112
- "@libp2p/peer-id-factory": "^4.0.2",
113
- "@libp2p/utils": "^5.1.1",
106
+ "@libp2p/interface": "^1.1.1",
107
+ "@libp2p/interface-internal": "^1.0.5",
108
+ "@libp2p/logger": "^4.0.4",
109
+ "@libp2p/multistream-select": "^5.1.1",
110
+ "@libp2p/peer-collections": "^5.1.3",
111
+ "@libp2p/peer-id": "^4.0.4",
112
+ "@libp2p/peer-id-factory": "^4.0.3",
113
+ "@libp2p/utils": "^5.2.0",
114
114
  "@multiformats/multiaddr": "^12.1.10",
115
115
  "abortable-iterator": "^5.0.1",
116
- "aegir": "^41.0.2",
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",
@@ -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 ?? name.trim() === '') {
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 ?? name.trim() === '') {
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 ?? name.trim() === '') {
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 ?? name.trim() === '') {
142
+ if (name == null || name.trim() === '') {
143
143
  throw new Error('Metric name is required')
144
144
  }
145
145