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:
@@ -129,6 +129,11 @@ class HyperBareHeadlessUi extends EventEmitter {
|
||||
return !s.pipeOpen && !s.ui
|
||||
}
|
||||
|
||||
size () {
|
||||
const s = this.snapshot()
|
||||
return (s.pipeOpen ? 1 : 0) + (s.ui ? 1 : 0)
|
||||
}
|
||||
|
||||
sendToUiBatch (messages) {
|
||||
if (!Array.isArray(messages)) throw new Error('messages array required')
|
||||
return messages.map((m) => this.sendToUi(m.channel, m.payload))
|
||||
|
||||
Reference in New Issue
Block a user