Add hasKey() and getKey() helpers across keyed modules (tenth pass).
Domain-aware lookup aliases on modules that already expose listKeys/keyCount, including async indexes and probabilistic bloom sets. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -116,6 +116,14 @@ class HyperP2POverlayTopology extends EventEmitter {
|
||||
return this.size()
|
||||
}
|
||||
|
||||
hasKey (key) {
|
||||
return this.hasNeighbor(key)
|
||||
}
|
||||
|
||||
getKey (key) {
|
||||
return this._neighbors.get(String(key)) ?? null
|
||||
}
|
||||
|
||||
getStats () {
|
||||
return { ...this._stats, degree: this._neighbors.size, protocol: PROTOCOL }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user