@logux/core
Advanced tools
Comparing version 0.6.0 to 0.6.1
# Change Log | ||
This project adheres to [Semantic Versioning](http://semver.org/). | ||
## 0.6.1 | ||
* Fix counters comparison in `isFirstOlder`. | ||
## 0.6 ᐁ | ||
@@ -5,0 +8,0 @@ * Use WebSocket Protocol version 4. |
import { LogStore } from '../log' | ||
interface storeCreator { | ||
(): LogStore | ||
} | ||
/** | ||
@@ -23,4 +19,4 @@ * Pass all common tests for Logux store to callback. | ||
name: string, | ||
testCreator: (storeCreator: storeCreator) => () => void | ||
testCreator: (storeCreator: () => LogStore) => () => void | ||
) => void | ||
): void |
@@ -1,6 +0,1 @@ | ||
function split (id) { | ||
let index = id.indexOf(' ') | ||
return [id.slice(0, index), id.slice(index + 1)] | ||
} | ||
function isFirstOlder (firstMeta, secondMeta) { | ||
@@ -19,16 +14,29 @@ if (firstMeta && !secondMeta) { | ||
let first = split(firstMeta.id) | ||
let second = split(secondMeta.id) | ||
if (first[1] > second[1]) { | ||
let first = firstMeta.id.split(' ') | ||
let second = secondMeta.id.split(' ') | ||
let firstNode = first[1] | ||
let secondNode = second[1] | ||
if (firstNode > secondNode) { | ||
return false | ||
} else if (first[1] < second[1]) { | ||
} else if (firstNode < secondNode) { | ||
return true | ||
} | ||
if (first[0] > second[0]) { | ||
let firstCounter = parseInt(first[2]) | ||
let secondCounter = parseInt(second[2]) | ||
if (firstCounter > secondCounter) { | ||
return false | ||
} else if (first[0] < second[0]) { | ||
} else if (firstCounter < secondCounter) { | ||
return true | ||
} | ||
let firstNodeTime = parseInt(first[0]) | ||
let secondNodeTime = parseInt(second[0]) | ||
if (firstNodeTime > secondNodeTime) { | ||
return false | ||
} else if (firstNodeTime < secondNodeTime) { | ||
return true | ||
} | ||
return false | ||
@@ -35,0 +43,0 @@ } |
{ | ||
"name": "@logux/core", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Logux core components", | ||
@@ -23,3 +23,3 @@ "keywords": [ | ||
"dependencies": { | ||
"nanoevents": "^5.1.7" | ||
"nanoevents": "^5.1.8" | ||
}, | ||
@@ -26,0 +26,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
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
161381
5233
Updatednanoevents@^5.1.8