New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@live-change/db

Package Overview
Dependencies
Maintainers
1
Versions
311
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@live-change/db - npm Package Compare versions

Comparing version

to
0.3.11

23

lib/AtomicWriter.js

@@ -78,2 +78,11 @@ function getProperty(of, propertyName) {

},
mergeSets(obj, { property, values }) {
const valuesStrs = values.map(e=>JSON.stringify(e))
updateProperty(obj, property, v => {
const current = (v ? (Array.isArray(v) ? v : [v]) : [])
const currentStrs = current.map(e=>JSON.stringify(e))
return Array.from(new Set([...valuesStrs, ...currentStrs])).map(x => JSON.parse(x))
})
return obj
},
add(obj, { property, value }) {

@@ -83,2 +92,16 @@ updateProperty(obj, property, v => (v||0) + value)

},
max(obj, { property, value }) {
updateProperty(obj, property, v => {
const current = (v || -Infinity)
return current > value ? current : value
})
return obj
},
min(obj, { property, value }) {
updateProperty(obj, property, v => {
const current = (v || Infinity)
return current < value ? current : value
})
return obj
},
merge(obj, { property, value }) {

@@ -85,0 +108,0 @@ if(property) return updateProperty(obj, property, v => mergeDeep(v, value))

2

package.json
{
"name": "@live-change/db",
"version": "0.3.10",
"version": "0.3.11",
"description": "Database with observable data for live queries",

@@ -5,0 +5,0 @@ "main": "index.js",