Add listKeys() and keyCount() helpers across modules (ninth pass).
Standardize key enumeration after size() on map- and registry-style modules, aliasing existing list* methods or primary store keys so callers can inspect occupancy without parsing snapshots. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -115,6 +115,14 @@ class HyperP2PLoadSpread extends EventEmitter {
|
||||
return this.snapshot().peers
|
||||
}
|
||||
|
||||
listKeys () {
|
||||
return this.peerIds()
|
||||
}
|
||||
|
||||
keyCount () {
|
||||
return this.size()
|
||||
}
|
||||
|
||||
registerPeerBatch (entries) {
|
||||
if (!Array.isArray(entries)) throw new Error('entries array required')
|
||||
for (const e of entries) this.registerPeer(e.peerId, e.load)
|
||||
|
||||
Reference in New Issue
Block a user