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.4.9 to 0.4.10

24

cjs/worker.js

@@ -20,17 +20,13 @@ 'use strict';

addEventListener('message', ({data: {id, action, options}}) => {
switch (action) {
case 'init':
if (!db)
db = load(options.library).then(({init}) => init(options));
return db.then(
() => postMessage({id, result: 'OK'}),
({message: error}) => postMessage({id, error})
);
case 'all':
return retrieve(db, 'all', id, options);
case 'get':
return retrieve(db, 'get', id, options);
case 'query':
return retrieve(db, 'query', id, options);
if (action === 'init') {
if (!db)
db = load(options.library).then(({init}) => init(options));
db.then(
() => postMessage({id, result: 'OK'}),
({message: error}) => postMessage({id, error})
);
}
// all, get, query do the same
else
retrieve(db, action, id, options);
});

@@ -1,1 +0,1 @@

!function(){"use strict";const{assign:e}=Object,t="function"==typeof importScripts,s=s=>new Promise(((r,o)=>{const n=()=>{const e=self.module.exports;delete self.exports,self.module=void 0,r(e)};if(self.exports={},self.module={exports:exports},t)importScripts(s),n();else{const{head:t}=document;e(t.appendChild(document.createElement("script")),{onload(){t.removeChild(this),n()},onerror:o,src:s})}}));let r=null;const o=(e,t,s,{template:r,values:o})=>{e.then((e=>{e[t].apply(null,[r].concat(o)).then((e=>{postMessage({id:s,result:e})}),(({message:e})=>{postMessage({id:s,error:e})}))}))};addEventListener("message",(({data:{id:e,action:t,options:n}})=>{switch(t){case"init":return r||(r=s(n.library).then((({init:e})=>e(n)))),r.then((()=>postMessage({id:e,result:"OK"})),(({message:t})=>postMessage({id:e,error:t})));case"all":return o(r,"all",e,n);case"get":return o(r,"get",e,n);case"query":return o(r,"query",e,n)}}))}();
!function(){"use strict";const{assign:e}=Object,s="function"==typeof importScripts,t=t=>new Promise(((o,n)=>{const r=()=>{const e=self.module.exports;delete self.exports,self.module=void 0,o(e)};if(self.exports={},self.module={exports:exports},s)importScripts(t),r();else{const{head:s}=document;e(s.appendChild(document.createElement("script")),{onload(){s.removeChild(this),r()},onerror:n,src:t})}}));let o=null;addEventListener("message",(({data:{id:e,action:s,options:n}})=>{"init"===s?(o||(o=t(n.library).then((({init:e})=>e(n)))),o.then((()=>postMessage({id:e,result:"OK"})),(({message:s})=>postMessage({id:e,error:s})))):((e,s,t,{template:o,values:n})=>{e.then((e=>{e[s].apply(null,[o].concat(n)).then((e=>{postMessage({id:t,result:e})}),(({message:e})=>{postMessage({id:t,error:e})}))}))})(o,s,e,n)}))}();

@@ -19,17 +19,13 @@ import {load} from './utils.js';

addEventListener('message', ({data: {id, action, options}}) => {
switch (action) {
case 'init':
if (!db)
db = load(options.library).then(({init}) => init(options));
return db.then(
() => postMessage({id, result: 'OK'}),
({message: error}) => postMessage({id, error})
);
case 'all':
return retrieve(db, 'all', id, options);
case 'get':
return retrieve(db, 'get', id, options);
case 'query':
return retrieve(db, 'query', id, options);
if (action === 'init') {
if (!db)
db = load(options.library).then(({init}) => init(options));
db.then(
() => postMessage({id, result: 'OK'}),
({message: error}) => postMessage({id, error})
);
}
// all, get, query do the same
else
retrieve(db, action, id, options);
});
{
"name": "sqlite-worker",
"version": "0.4.9",
"version": "0.4.10",
"description": "A simple, and persistent, SQLite database for Web and Workers",

@@ -5,0 +5,0 @@ "main": "./cjs/index.js",

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