Socket
Socket
Sign inDemoInstall

dexie

Package Overview
Dependencies
Maintainers
2
Versions
157
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dexie - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

7

addons/Dexie.Observable/Dexie.Observable.js
/// <reference path="../../src/Dexie.js" />
/*
* Disclaimber: This addon is in alpha status meaning that
* its API and behavior may change.
*/
(function (window, publish, isBrowser, undefined) {
"use strict"
"use strict";

@@ -6,0 +11,0 @@ /** class DatabaseChange

/// <reference path="../../../src/Dexie.js" />
/// <reference path="../Dexie.Observable/Dexie.Observable.js" />
/// <reference path="Dexie.Syncable.SyncProtocolAPI.js" />
/*
* Disclaimber: This addon is in alpha status meaning that
* its API and behavior may change.
*/
(function (window, publish, isBrowser, undefined) {

@@ -156,2 +161,39 @@

}
db.syncable.delete = function (url) {
// Notice: Caller should call db.syncable.disconnect(url) and wait for it to finish before calling db.syncable.delete(url)
// Surround with a readwrite-transaction
return db.transaction('rw', db._syncNodes, db._changes, db._uncommittedChanges, function() {
// Find the node
db._syncNodes.where("url").equals(url).first(function(node) {
// If not found, resolve here (nothing deleted), else continue the promise chain and
// delete the node and all that refers to it...
if (!node) {
return;
} else {
var nodeId = node.id;
// Delete the node
return db._syncNodes.delete(nodeId).then(function() {
// When this node is gone, let's clear the _changes table by
// from all revisions older than the oldest node.
// First check which is the currenly oldest node, now when we have deleted
// the given node:
return db._syncNodes.orderBy("myRevision").first();
}).then(function(oldestNode) {
// Delete all changes older than revision of oldest node:
return db._changes.where("rev").below(oldestNode.myRevision).delete();
}).then(function() {
// Also don't forget to delete all uncommittedChanges for the deleted node:
return db._uncommittedChanges.where('node').equals(nodeId).delete();
});
}
});
});
};
db.syncable.unsyncedChanges = function (url) {
return db._syncNodes.where("url").equals(url).first(function (node) {
return db._changes.where('rev').above(node.myRevision).toArray();
});
};

@@ -158,0 +200,0 @@ function connect (protocolInstance, protocolName, url, options, dbAliveID) {

2

bower.json

@@ -22,3 +22,3 @@ {

"**/.*",
"addons",
"addons/*/test",
"test",

@@ -25,0 +25,0 @@ "samples",

{
"name": "dexie",
"version": "1.0.1",
"version": "1.0.2",
"description": "Minimalistic IndexedDB API with bullet proof transactions",

@@ -5,0 +5,0 @@ "main": "src/Dexie.js",

Sorry, the diff of this file is too big to display

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