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:
@@ -165,6 +165,14 @@ class HyperP2PSubscriptionLease extends EventEmitter {
|
||||
return this.snapshot().leases
|
||||
}
|
||||
|
||||
listKeys () {
|
||||
return this.listChannels()
|
||||
}
|
||||
|
||||
keyCount () {
|
||||
return this.size()
|
||||
}
|
||||
|
||||
acquireBatch (channels) {
|
||||
if (!Array.isArray(channels)) throw new Error('channels array required')
|
||||
return channels.map((ch) => this.acquire(ch))
|
||||
|
||||
Reference in New Issue
Block a user