Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

crdt

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crdt - npm Package Compare versions

Comparing version 3.3.1 to 3.4.0

2

package.json

@@ -5,3 +5,3 @@ {

"description": "Commutative Replicated Data Types for easy distributed/collaborative apps",
"version": "3.3.1",
"version": "3.4.0",
"homepage": "http://github.com/dominictarr/crdt",

@@ -8,0 +8,0 @@ "repository": {

@@ -178,2 +178,7 @@ #CRDT - Commutative Replicated Data Types

### Set#onEach(iter)
Iterate over the `Rows` in the set and any new row that may be
added to the set in the future.
### Set#remove(row)

@@ -180,0 +185,0 @@

@@ -113,3 +113,2 @@ 'use strict';

}
}

@@ -121,2 +120,7 @@

Set.prototype.onEach = function (callback) {
this.forEach(callback)
this.on("add", callback)
}
Set.prototype.asArray = function () {

@@ -123,0 +127,0 @@ return this._array

@@ -77,5 +77,4 @@ var crdt = require('..')

exports['test - filters'] = function (t) {
console.log("HELLO")
var doc = new crdt.Doc()
console.log("# Filters")

@@ -97,2 +96,3 @@ var set = doc.createSet(function (state) {

doc.add({id: 'b', type: 'thing', what: 5})
//overwrite the first 'a'
doc.add({id: 'a', type: 'other', what: 7})

@@ -126,2 +126,28 @@ doc.add({id: 'c', type: 'thing', what: 9})

exports['test - create set later'] = function (t) {
var doc = new crdt.Doc()
console.log("LATER")
doc.add({id: 'a', type: 'thing', what: 3})
doc.add({id: 'b', type: 'thing', what: 5})
doc.add({id: 'a', type: 'other', what: 7})
doc.add({id: 'c', type: 'thing', what: 9})
var set = doc.createSet("type", "thing")
var states = []
set.onEach(function (row, state) {
console.log(state)
states.push(row.state)
})
a.deepEqual(states, [
{ id: 'b', type: 'thing', what: 5 },
{ id: 'c', type: 'thing', what: 9 }
])
t.end()
}
function log(set) {

@@ -137,1 +163,2 @@

}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc