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

@matrixai/db

Package Overview
Dependencies
Maintainers
3
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 1.0.0 to 1.0.1

6

dist/DB.d.ts

@@ -35,5 +35,5 @@ /// <reference types="node" />

};
lock?: MutexInterface;
fs?: FileSystem;
logger?: Logger;
lock: MutexInterface;
fs: FileSystem;
logger: Logger;
});

@@ -40,0 +40,0 @@ get db(): LevelDB<string, Buffer>;

@@ -34,6 +34,6 @@ "use strict";

class DB {
constructor({ dbPath, crypto, lock = new async_mutex_1.Mutex(), fs = require('fs'), logger, }) {
constructor({ dbPath, crypto, lock, fs, logger, }) {
this._running = false;
this._destroyed = false;
this.logger = logger ?? new logger_1.default(this.constructor.name);
this.logger = logger;
this.dbPath = dbPath;

@@ -44,3 +44,3 @@ this.crypto = crypto;

}
static async createDB({ dbPath, crypto, lock, fs, logger, }) {
static async createDB({ dbPath, crypto, lock = new async_mutex_1.Mutex(), fs = require('fs'), logger = new logger_1.default(this.name), }) {
const db = new DB({

@@ -123,4 +123,6 @@ dbPath,

}
this.logger.info('Destroying DB');
await this.fs.promises.rm(this.dbPath, { recursive: true });
this._destroyed = true;
this.logger.info('Destroyed DB');
});

@@ -127,0 +129,0 @@ }

{
"name": "@matrixai/db",
"version": "1.0.0",
"version": "1.0.1",
"author": "Roger Qiu",

@@ -24,3 +24,3 @@ "description": "DB",

"@matrixai/logger": "^2.0.1",
"@matrixai/workers": "^1.2.2",
"@matrixai/workers": "^1.2.3",
"abstract-leveldown": "^7.0.0",

@@ -27,0 +27,0 @@ "async-mutex": "^0.3.1",

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