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:
Raven Scott
2026-05-21 05:23:43 -04:00
co-authored by Cursor
parent de89303380
commit 7f4f31d4d4
118 changed files with 945 additions and 0 deletions
@@ -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)