Skip to content
This repository was archived by the owner on Jun 26, 2023. It is now read-only.

Commit 64598ec

Browse files
authored
fix: allow deleting tags/metadata with undefined fields (#384)
Allow passing `undefined` as a tag/metadata value to peerstore methods to allow removal of existing tags/metadata.
1 parent b744b38 commit 64598ec

File tree

1 file changed

+4
-4
lines changed
  • packages/interface-peer-store/src

1 file changed

+4
-4
lines changed

packages/interface-peer-store/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ export interface PeerData {
8181
protocols?: string[]
8282

8383
/**
84-
* Peer's metadata map
84+
* Peer's metadata map. When merging pass undefined as values to remove metadata.
8585
*/
86-
metadata?: Map<string, Uint8Array> | Record<string, Uint8Array>
86+
metadata?: Map<string, Uint8Array | undefined> | Record<string, Uint8Array | undefined>
8787

8888
/**
89-
* Peer tags
89+
* Peer tags. When merging pass undefined as values to remove tags.
9090
*/
91-
tags?: Map<string, TagOptions> | Record<string, TagOptions>
91+
tags?: Map<string, TagOptions | undefined> | Record<string, TagOptions | undefined>
9292

9393
/**
9494
* If this Peer has an RSA key, it's public key can be set with this property

0 commit comments

Comments
 (0)