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

better-sqlite3

Package Overview
Dependencies
Maintainers
1
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

better-sqlite3 - npm Package Compare versions

Comparing version 7.1.4 to 7.1.5

2

lib/database.js

@@ -12,3 +12,3 @@ 'use strict';

function Database(filenameGiven, options) {
if (new.target !== Database) {
if (new.target == null) {
return new Database(filenameGiven, options);

@@ -15,0 +15,0 @@ }

{
"name": "better-sqlite3",
"version": "7.1.4",
"version": "7.1.5",
"description": "The fastest and simplest library for SQLite3 in Node.js.",

@@ -5,0 +5,0 @@ "homepage": "http://github.com/JoshuaWise/better-sqlite3",

@@ -52,3 +52,3 @@ 'use strict';

expect(existsSync(util.next())).to.be.false;
const db = this.db = Database(util.current());
const db = this.db = new Database(util.current());
expect(db.name).to.equal(util.current());

@@ -135,2 +135,27 @@ expect(db.memory).to.be.false;

});
it('should work properly when called as a function', function () {
const db = this.db = Database(util.next());
expect(db).to.be.an.instanceof(Database);
expect(db.constructor).to.equal(Database);
expect(Database.prototype.close).to.equal(db.close);
expect(Database.prototype).to.equal(Object.getPrototypeOf(db));
});
it('should work properly when subclassed', function () {
class MyDatabase extends Database {
foo() {
return 999;
}
}
const db = this.db = new MyDatabase(util.next());
expect(db).to.be.an.instanceof(Database);
expect(db).to.be.an.instanceof(MyDatabase);
expect(db.constructor).to.equal(MyDatabase);
expect(Database.prototype.close).to.equal(db.close);
expect(MyDatabase.prototype.close).to.equal(db.close);
expect(Database.prototype.foo).to.be.undefined;
expect(MyDatabase.prototype.foo).to.equal(db.foo);
expect(Database.prototype).to.equal(Object.getPrototypeOf(MyDatabase.prototype));
expect(MyDatabase.prototype).to.equal(Object.getPrototypeOf(db));
expect(db.foo()).to.equal(999);
});
});
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