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

@nozbe/lokijs

Package Overview
Dependencies
Maintainers
6
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nozbe/lokijs - npm Package Compare versions

Comparing version 1.5.12-wmelon5 to 1.5.12-wmelon6

2

package.json
{
"name": "@nozbe/lokijs",
"version": "1.5.12-wmelon5",
"version": "1.5.12-wmelon6",
"description": "Nozbe's fork of LokiJS, optimized for WatermelonDB",

@@ -5,0 +5,0 @@ "homepage": "https://techfort.github.io/LokiJS/",

@@ -51,2 +51,4 @@ (function(root, factory) {

* Can be tuned for a specific application
* @param {array} options.lazyCollections Names of collections that should be deserialized lazily
* Only use this for collections that aren't used at launch
*/

@@ -539,4 +541,20 @@ function IncrementalIndexedDBAdapter(options) {

function onDidOpen(db) {
var openRequest = indexedDB.open(dbname, 1);
openRequest.onupgradeneeded = function(e) {
var db = e.target.result;
DEBUG && console.log('onupgradeneeded, old version: ' + e.oldVersion);
if (e.oldVersion < 1) {
// Version 1 - Initial - Create database
db.createObjectStore('LokiIncrementalData', { keyPath: "key" });
} else {
// Unknown version
throw new Error("Invalid old version " + e.oldVersion + " for IndexedDB upgrade");
}
};
openRequest.onsuccess = function(e) {
that.idbInitInProgress = false;
var db = e.target.result;
that.idb = db;

@@ -574,32 +592,4 @@

onSuccess();
}
if (this.options.preloads && this.options.preloads.idb) {
DEBUG && console.log('using preloaded idb');
onDidOpen(this.options.preloads.idb);
this.options.preloads.idb = null;
return;
}
var openRequest = indexedDB.open(dbname, 1);
openRequest.onupgradeneeded = function(e) {
var db = e.target.result;
DEBUG && console.log('onupgradeneeded, old version: ' + e.oldVersion);
if (e.oldVersion < 1) {
// Version 1 - Initial - Create database
db.createObjectStore('LokiIncrementalData', { keyPath: "key" });
} else {
// Unknown version
throw new Error("Invalid old version " + e.oldVersion + " for IndexedDB upgrade");
}
};
openRequest.onsuccess = function(e) {
that.idbInitInProgress = false;
var db = e.target.result;
onDidOpen(db);
};
openRequest.onblocked = function(e) {

@@ -703,13 +693,7 @@ console.error("IndexedDB open is blocked", e);

if (that.options.preloads && that.options.preloads.keys) {
DEBUG && console.log('using preloaded keys');
onDidGetKeys(that.options.preloads.keys);
that.options.preloads.keys = null;
} else {
idbReq(store.getAllKeys(), function(e) {
onDidGetKeys(e.target.result);
}, function(e) {
callback(e);
});
}
idbReq(store.getAllKeys(), function(e) {
onDidGetKeys(e.target.result);
}, function(e) {
callback(e);
});

@@ -716,0 +700,0 @@ if (that.options.onFetchStart) {

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