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

websql

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

websql - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

46

lib/websql/WebSQLDatabase.js

@@ -36,13 +36,3 @@ 'use strict';

function done(rollbackOrCommitError, results) {
var error = err || rollbackOrCommitError || null;
if (!error && typeof results !== "undefined") {
for (var i = 0; i < results.length; i++) {
var result = results[i];
if (result.error) {
error = result.error;
break;
}
}
}
function done(error) {
if (error) {

@@ -58,8 +48,36 @@ self._currentTask.errorCallback(error);

function rollbackDone(error) {
// Ignoring ROLLBACK errors as per
// https://www.sqlite.org/lang_transaction.html#response_to_errors_within_a_transaction
return function() {
done(error);
};
}
function findErrorInResults(results) {
for (var i = 0; i < results.length; i++) {
var result = results[i];
if (result.error) {
return result.error;
}
}
}
function commitDone(commitError, results) {
var error = commitError || findErrorInResults(results) || null;
if (error) {
// Explicit ROLLBACK on failed COMMIT as per
// https://www.sqlite.org/lang_transaction.html#response_to_errors_within_a_transaction
self._db.exec(ROLLBACK, false, rollbackDone(error));
} else {
done();
}
}
if (self._currentTask.readOnly) {
done(); // read-only doesn't require a transaction
done(err); // read-only doesn't require a transaction
} else if (err) {
self._db.exec(ROLLBACK, false, done);
self._db.exec(ROLLBACK, false, rollbackDone(err));
} else {
self._db.exec(COMMIT, false, done);
self._db.exec(COMMIT, false, commitDone);
}

@@ -66,0 +84,0 @@ };

{
"name": "websql",
"version": "2.0.2",
"version": "2.0.3",
"description": "WebSQL Database API, implemented for Node using sqlite3",

@@ -5,0 +5,0 @@ "repository": {

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