Comparing version 0.1.2 to 0.1.3
{ | ||
"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" | ||
} | ||
} |
@@ -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 } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
92280
23
2668
61