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:
@@ -132,6 +132,14 @@ class HyperP2PStreamAccessControl extends EventEmitter {
|
||||
return this.snapshot().total
|
||||
}
|
||||
|
||||
listKeys () {
|
||||
return [...this._tokens.keys()]
|
||||
}
|
||||
|
||||
keyCount () {
|
||||
return this.size()
|
||||
}
|
||||
|
||||
grantCapabilityBatch (entries) {
|
||||
if (!Array.isArray(entries)) throw new Error('entries array required')
|
||||
return entries.map((e) => this.grantCapability(e.streamId, e.subject, e.ttlMs))
|
||||
|
||||
Reference in New Issue
Block a user