@signalapp/better-sqlite3
Advanced tools
Comparing version 9.0.3 to 9.0.4
@@ -101,3 +101,3 @@ // Type definitions for better-sqlite3 7.6 | ||
interface DatabaseConstructor { | ||
new (filename: string | Buffer, options?: Database.Options): Database; | ||
new (filename: string, options?: Database.Options): Database; | ||
(filename: string, options?: Database.Options): Database; | ||
@@ -104,0 +104,0 @@ prototype: Database; |
@@ -15,7 +15,2 @@ 'use strict'; | ||
// Apply defaults | ||
let buffer; | ||
if (Buffer.isBuffer(filenameGiven)) { | ||
buffer = filenameGiven; | ||
filenameGiven = ':memory:'; | ||
} | ||
if (filenameGiven == null) filenameGiven = ''; | ||
@@ -40,3 +35,3 @@ if (options == null) options = {}; | ||
// Validate interpreted options | ||
if (readonly && anonymous && !buffer) throw new TypeError('In-memory/temporary databases cannot be readonly'); | ||
if (readonly && anonymous) throw new TypeError('In-memory/temporary databases cannot be readonly'); | ||
if (!Number.isInteger(timeout) || timeout < 0) throw new TypeError('Expected the "timeout" option to be a positive integer'); | ||
@@ -66,3 +61,3 @@ if (timeout > 0x7fffffff) throw new RangeError('Option "timeout" cannot be greater than 2147483647'); | ||
Object.defineProperties(this, { | ||
[util.cppdb]: { value: new addon.Database(filename, filenameGiven, anonymous, readonly, fileMustExist, timeout, verbose || null, buffer || null) }, | ||
[util.cppdb]: { value: new addon.Database(filename, filenameGiven, anonymous, readonly, fileMustExist, timeout, verbose || null) }, | ||
...wrappers.getters, | ||
@@ -69,0 +64,0 @@ }); |
{ | ||
"name": "@signalapp/better-sqlite3", | ||
"version": "9.0.3", | ||
"version": "9.0.4", | ||
"description": "The fastest and simplest library for SQLite3 in Node.js.", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/WiseLibs/better-sqlite3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
183897
789