Skip to content

Commit 928801a

Browse files
authored
fix: make kad-dht init object optional (#2618)
The default values set up an amino dht node so don't require an init arg since it can have no properties but still work.
1 parent bcd0183 commit 928801a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/kad-dht/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,6 @@ export interface KadDHTComponents {
459459
* Creates a custom DHT implementation, please ensure you pass a `protocol`
460460
* string as an option.
461461
*/
462-
export function kadDHT (init: KadDHTInit): (components: KadDHTComponents) => KadDHT {
462+
export function kadDHT (init: KadDHTInit = {}): (components: KadDHTComponents) => KadDHT {
463463
return (components: KadDHTComponents) => new KadDHTClass(components, init)
464464
}

packages/kad-dht/src/kad-dht.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export class KadDHT extends TypedEventEmitter<PeerDiscoveryEvents> implements Ka
127127
/**
128128
* Create a new KadDHT
129129
*/
130-
constructor (components: KadDHTComponents, init: KadDHTInit) {
130+
constructor (components: KadDHTComponents, init: KadDHTInit = {}) {
131131
super()
132132

133133
const {

0 commit comments

Comments
 (0)