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

@live-change/db-web

Package Overview
Dependencies
Maintainers
1
Versions
228
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@live-change/db-web - npm Package Compare versions

Comparing version 0.5.22 to 0.5.23

tests/run.sh

9

lib/Server.js

@@ -92,4 +92,8 @@ const ScriptContext = require('@live-change/db/lib/WebScriptContext.js')

async initialize(initOptions = {}) {
const jsonStr = localStorage[`${this.config.dbPrefix || ''}_lcdb`]
this.metadata = jsonStr && JSON.parse(jsonStr)
if(initOptions.metadata) {
this.metadata = initOptions.metadata
} else {
const jsonStr = localStorage[`${this.config.dbPrefix || ''}_lcdb`]
this.metadata = jsonStr && JSON.parse(jsonStr)
}
if(!this.metadata) {

@@ -127,2 +131,3 @@ this.metadata = {

(name) => dbStore.deleteStore(name),
dbName,
(context) => new ScriptContext(context)

@@ -129,0 +134,0 @@ )

{
"name": "@live-change/db-web",
"version": "0.5.22",
"version": "0.5.23",
"author": {

@@ -32,8 +32,8 @@ "email": "michal@laszczewski.com",

"dependencies": {
"@live-change/dao": "0.5.8",
"@live-change/db": "^0.5.22",
"@live-change/db-store-rbtree": "^0.5.22",
"@live-change/dao": "0.5.9",
"@live-change/db": "^0.5.23",
"@live-change/db-store-rbtree": "^0.5.23",
"debug": "^4.3.4"
},
"gitHead": "8428eb866bd0dc9d9ee247d77c120553713a5987"
"gitHead": "481a5cd01bd21e4caab4638bb0aa76e251fb2709"
}

@@ -178,4 +178,6 @@ const test = require('tape')

const mapper = (obj) => ({ id: obj.type+'_'+obj.id, to: obj.id })
await input.log('events').onChange((obj, oldObj) =>
output.change(obj && mapper(obj), oldObj && mapper(oldObj)) )
await input.log('events').onChange((obj, oldObj) => {
output.debug('change', JSON.stringify(obj), JSON.stringify(oldObj))
output.change(obj && mapper(obj), oldObj && mapper(oldObj))
})
}

@@ -187,10 +189,16 @@ })`)

const newEvent = { id: '7', name: 'henry' }
const newEvent = { type: 'new', value: 'henry' }
events.push(newEvent)
await client.request(['database', 'putLog'], 'index.test', 'events', newEvent)
console.log("EVENTS LOGGED:\n ",
(await client.get(['database', 'logRange', 'index.test', 'events', {}]))
.map(e => JSON.stringify(e)).join('\n'))
await delay(100)
results = await client.get(['database', 'indexRange', 'index.test', 'eventsByType', {}])
console.log("RESULTS", results.map(r => r.id))
console.log("EVENTS", events.map(e => e.type+'_'+e.id))
t.deepEqual(results.length, events.length)
})
})
})
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