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

crdts

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crdts - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

src/PN-Counter.js

5

package.json
{
"name": "crdts",
"version": "0.1.2",
"version": "0.1.3",
"description": "A CRDT Library for JavaScript",

@@ -29,4 +29,5 @@ "main": "src/index.js",

"scripts": {
"test": "./node_modules/.bin/mocha"
"test": "./node_modules/.bin/mocha",
"coverage": "istanbul cover ./node_modules/mocha/bin/_mocha"
}
}

7

README.md

@@ -55,2 +55,7 @@ # CRDTs

+-----------------------------------------------+
```
```
## CRDTs
CRDT research:
https://github.com/ipfs/research-CRDT

@@ -7,2 +7,3 @@ // Export all supported CRDTs

exports.LWWSet = LWWSet = require('./LWW-Set.js')
exports.PNCounter = PNCounter = require('./PN-Counter.js')

@@ -27,2 +28,3 @@ /**

LWWSet: LWWSet,
PNCounter: PNCounter
}

@@ -22,4 +22,4 @@ 'use strict'

this.value = value
this.added = new Set(added || [])
this.removed = new Set(removed || [])
this.added = new Set(added)
this.removed = new Set(removed)
}

@@ -26,0 +26,0 @@

@@ -178,2 +178,9 @@ 'use strict'

})
it('returns false for unequal counters - different counters', () => {
const counter1 = new Counter('A')
const counter2 = new Counter('A')
counter2._counters['extra'] = 'world'
assert.equal(counter1.isEqual(counter2), false)
})
})

@@ -180,0 +187,0 @@ })

@@ -22,2 +22,6 @@ 'use strict'

static isEqual (a, b) {
return a.id == b.id && a.time == b.time
}
static compare (a, b) {

@@ -24,0 +28,0 @@ if (!a || !a.time) a = { time: 0 }

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