New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sqlite-worker

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sqlite-worker - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

esm/sql-wasm-debug.wasm

16

cjs/init.js

@@ -12,7 +12,11 @@ 'use strict';

assign(indexedDB.open(name, version), {
onupgradeneeded({target: {result}}) {
onupgradeneeded({target: {result, transaction}}) {
if (!result.objectStoreNames.contains(STORE))
result.createObjectStore(STORE)
.createIndex(keyPath, keyPath, {unique: true});
resolve(result);
assign(transaction, {
oncomplete() {
resolve(result);
}
});
},

@@ -27,10 +31,12 @@ onsuccess({target: {result}}) {

const init = (options = {}) => new Promise((resolve, onerror) => {
// const {url} = ({url: require('url').pathToFileURL(__filename).href});
const dir = options.dir || 'https://sql.js.org/dist'; // url.slice(0, url.lastIndexOf('/'));
Promise.all([
opener(options.name || 'sqlite-worker'),
initSqlJs({
locateFile: file => (options.dir || 'https://sql.js.org/dist') + '/' + file
locateFile: file => dir + '/' + file
})
]).then(
([idb, {Database}]) => {
const store = how => idb.transaction([STORE], how).objectStore(STORE);
([iDB, {Database}]) => {
const store = how => iDB.transaction([STORE], how).objectStore(STORE);
assign(store('readonly').get(keyPath), {

@@ -37,0 +43,0 @@ onsuccess() {

@@ -11,7 +11,11 @@ import SQLiteTag from 'sqlite-tag';

assign(indexedDB.open(name, version), {
onupgradeneeded({target: {result}}) {
onupgradeneeded({target: {result, transaction}}) {
if (!result.objectStoreNames.contains(STORE))
result.createObjectStore(STORE)
.createIndex(keyPath, keyPath, {unique: true});
resolve(result);
assign(transaction, {
oncomplete() {
resolve(result);
}
});
},

@@ -26,10 +30,12 @@ onsuccess({target: {result}}) {

export const init = (options = {}) => new Promise((resolve, onerror) => {
// const {url} = import.meta;
const dir = options.dir || 'https://sql.js.org/dist'; // url.slice(0, url.lastIndexOf('/'));
Promise.all([
opener(options.name || 'sqlite-worker'),
initSqlJs({
locateFile: file => (options.dir || 'https://sql.js.org/dist') + '/' + file
locateFile: file => dir + '/' + file
})
]).then(
([idb, {Database}]) => {
const store = how => idb.transaction([STORE], how).objectStore(STORE);
([iDB, {Database}]) => {
const store = how => iDB.transaction([STORE], how).objectStore(STORE);
assign(store('readonly').get(keyPath), {

@@ -36,0 +42,0 @@ onsuccess() {

{
"name": "sqlite-worker",
"version": "0.1.4",
"version": "0.1.5",
"description": "A simple, and persistent, SQLite database for Web and Workers",

@@ -8,3 +8,3 @@ "main": "./cjs/index.js",

"build": "npm run import && npm run cjs && npm run rollup:es",
"import": "terser node_modules/sql.js/dist/sql-wasm-debug.js -m -o esm/sql-wasm.js && sed -i 's/module=undefined;/var module=void 0;/' esm/sql-wasm.js && echo ';export default initSqlJs;' >> esm/sql-wasm.js",
"import": "cp node_modules/sql.js/dist/sql-wasm-debug.wasm esm/ && terser node_modules/sql.js/dist/sql-wasm-debug.js -m -o esm/sql-wasm.js && sed -i 's/module=undefined;/self.module=undefined;/' esm/sql-wasm.js && echo ';export default initSqlJs;' >> esm/sql-wasm.js",
"cjs": "ascjs --no-default esm cjs",

@@ -11,0 +11,0 @@ "rollup:es": "rollup --config rollup/es.config.js && sed -i.bck 's/^var /self./' es.js && rm -rf es.js.bck"

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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