Skip to content

Commit

Permalink
fix: make kad-dht init object optional
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
achingbrain committed Jul 14, 2024
1 parent bcd0183 commit 56b2e07
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/kad-dht/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,6 @@ export interface KadDHTComponents {
* Creates a custom DHT implementation, please ensure you pass a `protocol`
* string as an option.
*/
export function kadDHT (init: KadDHTInit): (components: KadDHTComponents) => KadDHT {
export function kadDHT (init: KadDHTInit = {}): (components: KadDHTComponents) => KadDHT {
return (components: KadDHTComponents) => new KadDHTClass(components, init)
}
2 changes: 1 addition & 1 deletion packages/kad-dht/src/kad-dht.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export class KadDHT extends TypedEventEmitter<PeerDiscoveryEvents> implements Ka
/**
* Create a new KadDHT
*/
constructor (components: KadDHTComponents, init: KadDHTInit) {
constructor (components: KadDHTComponents, init: KadDHTInit = {}) {
super()

const {
Expand Down

0 comments on commit 56b2e07

Please sign in to comment.