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

@matrixai/db

Package Overview
Dependencies
Maintainers
4
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@matrixai/db - npm Package Compare versions

Comparing version 3.3.1 to 3.3.2

4

dist/DB.js

@@ -133,3 +133,3 @@ "use strict";

catch (e) {
await tran.rollback();
await tran.rollback(e);
throw e;

@@ -140,3 +140,3 @@ }

else {
await tran.rollback();
await tran.rollback(e);
}

@@ -143,0 +143,0 @@ }

@@ -44,3 +44,4 @@ /// <reference types="node" />

protected _callbacksSuccess: Array<() => any>;
protected _callbacksFailure: Array<() => any>;
protected _callbacksFailure: Array<(e?: Error) => any>;
protected _callbacksFinally: Array<(e?: Error) => any>;
protected _committed: boolean;

@@ -77,7 +78,8 @@ protected _rollbacked: boolean;

queueSuccess(f: () => any): void;
queueFailure(f: () => any): void;
queueFailure(f: (e?: Error) => any): void;
queueFinally(f: (e?: Error) => any): void;
commit(): Promise<void>;
rollback(): Promise<void>;
rollback(e?: Error): Promise<void>;
finalize(): Promise<void>;
}
export default DBTransaction;

@@ -39,2 +39,3 @@ "use strict";

this._callbacksFailure = [];
this._callbacksFinally = [];
this._committed = false;

@@ -282,2 +283,5 @@ this._rollbacked = false;

}
queueFinally(f) {
this._callbacksFinally.push(f);
}
async commit() {

@@ -299,3 +303,3 @@ if (this._rollbacked) {

}
async rollback() {
async rollback(e) {
if (this._committed) {

@@ -309,4 +313,7 @@ throw new errors.ErrorDBTransactionCommitted();

for (const f of this._callbacksFailure) {
await f();
await f(e);
}
for (const f of this._callbacksFinally) {
await f(e);
}
}

@@ -323,2 +330,5 @@ async finalize() {

}
for (const f of this._callbacksFinally) {
await f();
}
}

@@ -355,2 +365,5 @@ };

CreateDestroy_1.ready(new errors.ErrorDBTransactionDestroyed())
], DBTransaction.prototype, "queueFinally", null);
__decorate([
CreateDestroy_1.ready(new errors.ErrorDBTransactionDestroyed())
], DBTransaction.prototype, "commit", null);

@@ -357,0 +370,0 @@ __decorate([

{
"name": "@matrixai/db",
"version": "3.3.1",
"version": "3.3.2",
"author": "Roger Qiu",

@@ -5,0 +5,0 @@ "description": "DB",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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