better-sqlite3
Advanced tools
Comparing version 8.5.2 to 8.6.0
@@ -21,7 +21,12 @@ 'use strict'; | ||
for (const { filename, optional } of files) { | ||
if (optional && !fs.existsSync(path.join(source, filename))) { | ||
const sourceFilepath = path.join(source, filename); | ||
const destFilepath = path.join(dest, filename); | ||
if (optional && !fs.existsSync(sourceFilepath)) { | ||
continue; | ||
} | ||
fs.accessSync(path.join(source, filename)); | ||
fs.copyFileSync(path.join(source, filename), path.join(dest, filename)); | ||
fs.accessSync(sourceFilepath); | ||
fs.mkdirSync(path.dirname(destFilepath), { recursive: true }); | ||
fs.copyFileSync(sourceFilepath, destFilepath); | ||
} |
@@ -36,3 +36,3 @@ 'use strict'; | ||
const verbose = 'verbose' in options ? options.verbose : null; | ||
const nativeBindingPath = 'nativeBinding' in options ? options.nativeBinding : null; | ||
const nativeBinding = 'nativeBinding' in options ? options.nativeBinding : null; | ||
@@ -44,11 +44,17 @@ // Validate interpreted options | ||
if (verbose != null && typeof verbose !== 'function') throw new TypeError('Expected the "verbose" option to be a function'); | ||
if (nativeBindingPath != null && typeof nativeBindingPath !== 'string') throw new TypeError('Expected the "nativeBinding" option to be a string'); | ||
if (nativeBinding != null && typeof nativeBinding !== 'string' && typeof nativeBinding !== 'object') throw new TypeError('Expected the "nativeBinding" option to be a string or addon object'); | ||
// Load the native addon | ||
let addon; | ||
if (nativeBindingPath == null) { | ||
if (nativeBinding == null) { | ||
addon = DEFAULT_ADDON || (DEFAULT_ADDON = require('bindings')('better_sqlite3.node')); | ||
} else if (typeof nativeBinding === 'string') { | ||
// See <https://webpack.js.org/api/module-variables/#__non_webpack_require__-webpack-specific> | ||
const requireFunc = typeof __non_webpack_require__ === 'function' ? __non_webpack_require__ : require; | ||
addon = requireFunc(path.resolve(nativeBinding).replace(/(\.node)?$/, '.node')); | ||
} else { | ||
addon = require(path.resolve(nativeBindingPath).replace(/(\.node)?$/, '.node')); | ||
// See <https://github.com/WiseLibs/better-sqlite3/issues/972> | ||
addon = nativeBinding; | ||
} | ||
if (!addon.isInitialized) { | ||
@@ -55,0 +61,0 @@ addon.setErrorConstructor(SqliteError); |
{ | ||
"name": "better-sqlite3", | ||
"version": "8.5.2", | ||
"version": "8.6.0", | ||
"description": "The fastest and simplest library for SQLite3 in Node.js.", | ||
@@ -20,14 +20,14 @@ "homepage": "http://github.com/WiseLibs/better-sqlite3", | ||
"bindings": "^1.5.0", | ||
"prebuild-install": "^7.1.0" | ||
"prebuild-install": "^7.1.1" | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.3.6", | ||
"cli-color": "^2.0.2", | ||
"fs-extra": "^10.1.0", | ||
"chai": "^4.3.8", | ||
"cli-color": "^2.0.3", | ||
"fs-extra": "^11.1.1", | ||
"mocha": "^10.2.0", | ||
"node-gyp": "8.4.1", | ||
"node-gyp": "9.4.0", | ||
"nodemark": "^0.3.0", | ||
"prebuild": "^11.0.4", | ||
"sqlite": "^4.1.1", | ||
"sqlite3": "^5.0.8" | ||
"sqlite": "^5.0.1", | ||
"sqlite3": "^5.1.6" | ||
}, | ||
@@ -34,0 +34,0 @@ "overrides": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
9731207
571
Updatedprebuild-install@^7.1.1