better-sqlite3
Advanced tools
Comparing version 2.3.1 to 2.3.2
@@ -14,8 +14,3 @@ 'use strict'; | ||
} | ||
var filename = filenameGiven.trim(); | ||
if (typeof options !== 'object' || options === null) { | ||
options = {}; | ||
} | ||
if (!filename) { | ||
@@ -31,3 +26,9 @@ throw new TypeError('A database filename cannot be an empty string.'); | ||
if (options.memory) { | ||
if (typeof options !== 'object' || options === null) { | ||
options = {}; | ||
} | ||
var memory = getBoolean(options, 'memory'); | ||
var readonly = getBoolean(options, 'readonly'); | ||
if (memory) { | ||
if (process.platform === 'win32') { | ||
@@ -46,3 +47,3 @@ filename = filename.replace(/\\/g, '/').replace(/^[a-z]:\//i, '/$&'); | ||
return new CPPDatabase(filename, filenameGiven, !!options.memory, !!options.readonly); | ||
return new CPPDatabase(filename, filenameGiven, memory, readonly); | ||
} | ||
@@ -63,5 +64,5 @@ | ||
var defaultSafeIntegers = !('safeIntegers' in options); | ||
var deterministic = getOption(options, 'deterministic'); | ||
var safeIntegers = getOption(options, 'safeIntegers'); | ||
var varargs = getOption(options, 'varargs'); | ||
var deterministic = getBoolean(options, 'deterministic'); | ||
var safeIntegers = getBoolean(options, 'safeIntegers'); | ||
var varargs = getBoolean(options, 'varargs'); | ||
var argCount = func.length; | ||
@@ -82,3 +83,3 @@ if (typeof name !== 'string') { | ||
function getOption(options, key) { | ||
function getBoolean(options, key) { | ||
if (key in options && typeof options[key] !== 'boolean') { | ||
@@ -85,0 +86,0 @@ throw new TypeError('Expected the "' + key + '" option to be a boolean.'); |
{ | ||
"name": "better-sqlite3", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"description": "The fastest and simplest library for SQLite3 in Node.js.", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/JoshuaWise/better-sqlite3", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2721837
2195