Expand pear, media, experimental, state, and messaging modules
Add manual API helpers across categories: pear runtime/embed/runner/spawn, preflight cancel, update gossip history, headless UI pipe helpers, media origin weights and latency paths, experimental void/tension/time-capsule, CRDT conflict-set and grow-only-set, job dispatcher peek, trust graph decay, session rotateAll, topic channel batch unsubscribe, fulltext searchOr, FEC batch encode, marketplace cheapest listing, and noise session closeAll. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -86,6 +86,17 @@ class HyperP2PConflictSet extends EventEmitter {
|
||||
return out
|
||||
}
|
||||
|
||||
bulkAdd (values) {
|
||||
if (!Array.isArray(values)) throw new Error('values array required')
|
||||
return values.map((v) => this.add(v))
|
||||
}
|
||||
|
||||
clearLive () {
|
||||
const live = this.values()
|
||||
for (const v of live) this.remove(v)
|
||||
return live.length
|
||||
}
|
||||
|
||||
merge (remote) {
|
||||
if (!remote || !remote.elements) return false
|
||||
let changed = false
|
||||
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "hyper-p2p-conflict-set",
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "hyper-p2p-conflict-set",
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"b4a": "^1.6.7",
|
||||
|
||||
@@ -73,6 +73,11 @@ class HyperP2PCrdtGrowOnlySet extends EventEmitter {
|
||||
return this.values().filter((el) => !other.has(el))
|
||||
}
|
||||
|
||||
intersection (other) {
|
||||
if (!other || typeof other.has !== 'function') throw new Error('other set required')
|
||||
return this.values().filter((el) => other.has(el))
|
||||
}
|
||||
|
||||
_gossip (data) {
|
||||
if (!this._peerMsgs) return
|
||||
gossipSend(this, data)
|
||||
|
||||
Reference in New Issue
Block a user