Add size() cardinality helper across modules (eighth pass).
Standardize a size() method after isEmpty() on every module with clearAll(), delegating to domain counts or snapshot fields so callers can query occupancy without parsing snapshots. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -121,6 +121,11 @@ class HyperP2PDriveMirrorSync extends EventEmitter {
|
||||
return s.pending === 0 && s.tracked === 0
|
||||
}
|
||||
|
||||
size () {
|
||||
const s = this.snapshot()
|
||||
return s.pending + s.tracked
|
||||
}
|
||||
|
||||
getStats () {
|
||||
return driveStats(this._stats, PROTOCOL, {
|
||||
pending: this._queue.length,
|
||||
|
||||
Reference in New Issue
Block a user