Huge News!Announcing our $40M Series B led by Abstract Ventures.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.2 to 0.4.3

3

cjs/utils.js

@@ -11,3 +11,3 @@ 'use strict';

// https://stackoverflow.com/questions/44118600/web-workers-how-to-import-modules/45578811#45578811
const load = src => new Promise(resolve => {
const load = src => new Promise((resolve, onerror) => {
const onload = () => {

@@ -37,2 +37,3 @@ const module = self.module.exports;

},
onerror,
src

@@ -39,0 +40,0 @@ }

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

const{assign:e}=Object,t="function"==typeof importScripts,r=t?".":import.meta.url.replace(/\/[^/]*$/,""),o=r=>new Promise((o=>{const n=()=>{const e=self.module.exports;delete self.exports,self.module=void 0,o(e)};if(self.exports={},self.module={exports:exports},t)importScripts(r),n();else{const{head:t}=document;e(t.appendChild(document.createElement("script")),{onload(){t.removeChild(this),n()},src:r})}}));const n=new WeakMap,s=(e,...t)=>{const{t:r,v:o}=((e,t)=>{const r=[e[0]],o=[];for(let n=0,s=0,c=0,{length:a}=t;s<a;s++)t[s]instanceof l?r[n]+=t[s].v+e[s+1]:(o[c++]=s,r[++n]=e[s+1]);return{t:r,v:o}})(e,t),s=n.get(e)||n.set(e,{}).get(e);return(s[r]||(s[r]=[r])).concat(o.map((e=>t[e])))};function l(e){this.v=e}const c=(e,t)=>(r,...o)=>new Promise(((n,l)=>{r.some(u)&&l(a(new Error("SQLITE_ERROR: SQL injection hazard")));const[c,...i]=s(r,...o);e[t](c.join("?"),i,((e,t)=>{e?l(e):n(t)}))})),a=e=>(e.code="SQLITE_ERROR",e),i=(e,...t)=>new l(function(e){for(var t=e[0],r=1,o=arguments.length;r<o;r++)t+=arguments[r]+e[r];return t}(e,...t)),u=e=>e.includes("?");function d(e){return{all:c(e,"all"),get:c(e,"get"),query:c(e,"run"),raw:i}}const p=(t,r=1)=>new Promise(((o,n)=>{e(indexedDB.open(t,r),{onupgradeneeded({target:{result:t,transaction:r}}){t.objectStoreNames.contains("sqlite")||t.createObjectStore("sqlite").createIndex("buffer","buffer",{unique:!0}),e(r,{oncomplete(){o(t)}})},onsuccess({target:{result:e}}){o(e)},onerror:n})})),m=(t={})=>new Promise(((n,s)=>{const l=t.dist||r;o(l+"/sql-wasm.js").then((({default:r})=>{Promise.all([p(t.name||"sqlite-worker"),r({locateFile:e=>l+"/"+e})]).then((([r,{Database:o}])=>{const l=e=>r.transaction(["sqlite"],e).objectStore("sqlite");e(l("readonly").get("buffer"),{onsuccess(){let r=Promise.resolve();const{result:s}=this,c=new o(s||t.database||new Uint8Array(0)),a=()=>{r=r.then((()=>new Promise(((r,o)=>{const n=c.export();e(l("readwrite").put(n,"buffer").transaction,{oncomplete(){r(),t.update&&t.update(n)},onabort:o,onerror:o})}))))};s||a();const{all:i,get:u,query:p,raw:m}=d({all(e,t,r){try{const o=c.exec(e,t),n=[];o.forEach(f,n),r(null,n)}catch(e){r(e)}},get(e,t,r){try{const o=c.exec(e+" LIMIT 1",t),n=[];o.forEach(f,n),r(null,n.shift()||null)}catch(e){r(e)}},run(e,t,r){try{r(null,c.run(e,t))}catch(e){r(e)}}});let h=0;n({all:i,get:u,raw:m,query(e){return/\b(?:INSERT|DELETE|UPDATE)\b/i.test(e[0])&&(clearTimeout(h),h=setTimeout(a,t.timeout||250)),p.apply(this,arguments)}})},onerror:s})}),s)}))}));function f({columns:e,values:t}){for(let{length:r}=t,o=0;o<r;o++){const r=t[o],n={};for(let{length:t}=e,o=0;o<t;o++)n[e[o]]=r[o];this.push(n)}}const h=new Map;let g=0;function w(t){const o=t.dist||r,n=e=>(t,...r)=>s(e,{template:t,values:r}),s=(e,t)=>new Promise(((r,o)=>{const n=g++;h.set(n,{resolve:r,reject:o}),l.postMessage({id:n,action:e,options:t})})),l=e(new Worker(t.worker||o+"/worker.js"),{onmessage({data:{id:e,result:t,error:r}}){const{resolve:o,reject:n}=h.get(e);h.delete(e),r?n(r):o(t)}});return s("init",e({library:o+"/init.js"},t)).then((()=>({all:n("all"),get:n("get"),query:n("query")})))}export{w as SQLiteWorker,m as init};
const{assign:e}=Object,t="function"==typeof importScripts,r=t?".":import.meta.url.replace(/\/[^/]*$/,""),o=r=>new Promise(((o,n)=>{const s=()=>{const e=self.module.exports;delete self.exports,self.module=void 0,o(e)};if(self.exports={},self.module={exports:exports},t)importScripts(r),s();else{const{head:t}=document;e(t.appendChild(document.createElement("script")),{onload(){t.removeChild(this),s()},onerror:n,src:r})}}));const n=new WeakMap,s=(e,...t)=>{const{t:r,v:o}=((e,t)=>{const r=[e[0]],o=[];for(let n=0,s=0,c=0,{length:a}=t;s<a;s++)t[s]instanceof l?r[n]+=t[s].v+e[s+1]:(o[c++]=s,r[++n]=e[s+1]);return{t:r,v:o}})(e,t),s=n.get(e)||n.set(e,{}).get(e);return(s[r]||(s[r]=[r])).concat(o.map((e=>t[e])))};function l(e){this.v=e}const c=(e,t)=>(r,...o)=>new Promise(((n,l)=>{r.some(u)&&l(a(new Error("SQLITE_ERROR: SQL injection hazard")));const[c,...i]=s(r,...o);e[t](c.join("?"),i,((e,t)=>{e?l(e):n(t)}))})),a=e=>(e.code="SQLITE_ERROR",e),i=(e,...t)=>new l(function(e){for(var t=e[0],r=1,o=arguments.length;r<o;r++)t+=arguments[r]+e[r];return t}(e,...t)),u=e=>e.includes("?");function d(e){return{all:c(e,"all"),get:c(e,"get"),query:c(e,"run"),raw:i}}const p=(t,r=1)=>new Promise(((o,n)=>{e(indexedDB.open(t,r),{onupgradeneeded({target:{result:t,transaction:r}}){t.objectStoreNames.contains("sqlite")||t.createObjectStore("sqlite").createIndex("buffer","buffer",{unique:!0}),e(r,{oncomplete(){o(t)}})},onsuccess({target:{result:e}}){o(e)},onerror:n})})),m=(t={})=>new Promise(((n,s)=>{const l=t.dist||r;o(l+"/sql-wasm.js").then((({default:r})=>{Promise.all([p(t.name||"sqlite-worker"),r({locateFile:e=>l+"/"+e})]).then((([r,{Database:o}])=>{const l=e=>r.transaction(["sqlite"],e).objectStore("sqlite");e(l("readonly").get("buffer"),{onsuccess(){let r=Promise.resolve();const{result:s}=this,c=new o(s||t.database||new Uint8Array(0)),a=()=>{r=r.then((()=>new Promise(((r,o)=>{const n=c.export();e(l("readwrite").put(n,"buffer").transaction,{oncomplete(){r(),t.update&&t.update(n)},onabort:o,onerror:o})}))))};s||a();const{all:i,get:u,query:p,raw:m}=d({all(e,t,r){try{const o=c.exec(e,t),n=[];o.forEach(f,n),r(null,n)}catch(e){r(e)}},get(e,t,r){try{const o=c.exec(e+" LIMIT 1",t),n=[];o.forEach(f,n),r(null,n.shift()||null)}catch(e){r(e)}},run(e,t,r){try{r(null,c.run(e,t))}catch(e){r(e)}}});let h=0;n({all:i,get:u,raw:m,query(e){return/\b(?:INSERT|DELETE|UPDATE)\b/i.test(e[0])&&(clearTimeout(h),h=setTimeout(a,t.timeout||250)),p.apply(this,arguments)}})},onerror:s})}),s)}))}));function f({columns:e,values:t}){for(let{length:r}=t,o=0;o<r;o++){const r=t[o],n={};for(let{length:t}=e,o=0;o<t;o++)n[e[o]]=r[o];this.push(n)}}const h=new Map;let g=0;function w(t){const o=t.dist||r,n=e=>(t,...r)=>s(e,{template:t,values:r}),s=(e,t)=>new Promise(((r,o)=>{const n=g++;h.set(n,{resolve:r,reject:o}),l.postMessage({id:n,action:e,options:t})})),l=e(new Worker(t.worker||o+"/worker.js"),{onmessage({data:{id:e,result:t,error:r}}){const{resolve:o,reject:n}=h.get(e);h.delete(e),r?n(r):o(t)}});return s("init",e({library:o+"/init.js"},t)).then((()=>({all:n("all"),get:n("get"),query:n("query")})))}export{w as SQLiteWorker,m as init};

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

const e=new WeakMap,t=(t,...o)=>{const{t:r,v:s}=((e,t)=>{const o=[e[0]],r=[];for(let s=0,c=0,l=0,{length:a}=t;c<a;c++)t[c]instanceof n?o[s]+=t[c].v+e[c+1]:(r[l++]=c,o[++s]=e[c+1]);return{t:o,v:r}})(t,o),c=e.get(t)||e.set(t,{}).get(t);return(c[r]||(c[r]=[r])).concat(s.map((e=>o[e])))};function n(e){this.v=e}const o=(e,n)=>(o,...s)=>new Promise(((l,a)=>{o.some(c)&&a(r(new Error("SQLITE_ERROR: SQL injection hazard")));const[i,...u]=t(o,...s);e[n](i.join("?"),u,((e,t)=>{e?a(e):l(t)}))})),r=e=>(e.code="SQLITE_ERROR",e),s=(e,...t)=>new n(function(e){for(var t=e[0],n=1,o=arguments.length;n<o;n++)t+=arguments[n]+e[n];return t}(e,...t)),c=e=>e.includes("?");function l(e){return{all:o(e,"all"),get:o(e,"get"),query:o(e,"run"),raw:s}}const{assign:a}=Object,i="function"==typeof importScripts,u=e=>new Promise((t=>{const n=()=>{const e=self.module.exports;delete self.exports,self.module=void 0,t(e)};if(self.exports={},self.module={exports:exports},i)importScripts(e),n();else{const{head:t}=document;a(t.appendChild(document.createElement("script")),{onload(){t.removeChild(this),n()},src:e})}})),f=(e,t=1)=>new Promise(((n,o)=>{a(indexedDB.open(e,t),{onupgradeneeded({target:{result:e,transaction:t}}){e.objectStoreNames.contains("sqlite")||e.createObjectStore("sqlite").createIndex("buffer","buffer",{unique:!0}),a(t,{oncomplete(){n(e)}})},onsuccess({target:{result:e}}){n(e)},onerror:o})}));function d({columns:e,values:t}){for(let{length:n}=t,o=0;o<n;o++){const n=t[o],r={};for(let{length:t}=e,o=0;o<t;o++)r[e[o]]=n[o];this.push(r)}}exports.init=(e={})=>new Promise(((t,n)=>{const o=e.dist||".";u(o+"/sql-wasm.js").then((({default:r})=>{Promise.all([f(e.name||"sqlite-worker"),r({locateFile:e=>o+"/"+e})]).then((([o,{Database:r}])=>{const s=e=>o.transaction(["sqlite"],e).objectStore("sqlite");a(s("readonly").get("buffer"),{onsuccess(){let n=Promise.resolve();const{result:o}=this,c=new r(o||e.database||new Uint8Array(0)),i=()=>{n=n.then((()=>new Promise(((t,n)=>{const o=c.export();a(s("readwrite").put(o,"buffer").transaction,{oncomplete(){t(),e.update&&e.update(o)},onabort:n,onerror:n})}))))};o||i();const{all:u,get:f,query:m,raw:p}=l({all(e,t,n){try{const o=c.exec(e,t),r=[];o.forEach(d,r),n(null,r)}catch(e){n(e)}},get(e,t,n){try{const o=c.exec(e+" LIMIT 1",t),r=[];o.forEach(d,r),n(null,r.shift()||null)}catch(e){n(e)}},run(e,t,n){try{n(null,c.run(e,t))}catch(e){n(e)}}});let h=0;t({all:u,get:f,raw:p,query(t){return/\b(?:INSERT|DELETE|UPDATE)\b/i.test(t[0])&&(clearTimeout(h),h=setTimeout(i,e.timeout||250)),m.apply(this,arguments)}})},onerror:n})}),n)}))}));
const e=new WeakMap,t=(t,...o)=>{const{t:r,v:s}=((e,t)=>{const o=[e[0]],r=[];for(let s=0,c=0,l=0,{length:a}=t;c<a;c++)t[c]instanceof n?o[s]+=t[c].v+e[c+1]:(r[l++]=c,o[++s]=e[c+1]);return{t:o,v:r}})(t,o),c=e.get(t)||e.set(t,{}).get(t);return(c[r]||(c[r]=[r])).concat(s.map((e=>o[e])))};function n(e){this.v=e}const o=(e,n)=>(o,...s)=>new Promise(((l,a)=>{o.some(c)&&a(r(new Error("SQLITE_ERROR: SQL injection hazard")));const[i,...u]=t(o,...s);e[n](i.join("?"),u,((e,t)=>{e?a(e):l(t)}))})),r=e=>(e.code="SQLITE_ERROR",e),s=(e,...t)=>new n(function(e){for(var t=e[0],n=1,o=arguments.length;n<o;n++)t+=arguments[n]+e[n];return t}(e,...t)),c=e=>e.includes("?");function l(e){return{all:o(e,"all"),get:o(e,"get"),query:o(e,"run"),raw:s}}const{assign:a}=Object,i="function"==typeof importScripts,u=e=>new Promise(((t,n)=>{const o=()=>{const e=self.module.exports;delete self.exports,self.module=void 0,t(e)};if(self.exports={},self.module={exports:exports},i)importScripts(e),o();else{const{head:t}=document;a(t.appendChild(document.createElement("script")),{onload(){t.removeChild(this),o()},onerror:n,src:e})}})),f=(e,t=1)=>new Promise(((n,o)=>{a(indexedDB.open(e,t),{onupgradeneeded({target:{result:e,transaction:t}}){e.objectStoreNames.contains("sqlite")||e.createObjectStore("sqlite").createIndex("buffer","buffer",{unique:!0}),a(t,{oncomplete(){n(e)}})},onsuccess({target:{result:e}}){n(e)},onerror:o})}));function d({columns:e,values:t}){for(let{length:n}=t,o=0;o<n;o++){const n=t[o],r={};for(let{length:t}=e,o=0;o<t;o++)r[e[o]]=n[o];this.push(r)}}exports.init=(e={})=>new Promise(((t,n)=>{const o=e.dist||".";u(o+"/sql-wasm.js").then((({default:r})=>{Promise.all([f(e.name||"sqlite-worker"),r({locateFile:e=>o+"/"+e})]).then((([o,{Database:r}])=>{const s=e=>o.transaction(["sqlite"],e).objectStore("sqlite");a(s("readonly").get("buffer"),{onsuccess(){let n=Promise.resolve();const{result:o}=this,c=new r(o||e.database||new Uint8Array(0)),i=()=>{n=n.then((()=>new Promise(((t,n)=>{const o=c.export();a(s("readwrite").put(o,"buffer").transaction,{oncomplete(){t(),e.update&&e.update(o)},onabort:n,onerror:n})}))))};o||i();const{all:u,get:f,query:m,raw:p}=l({all(e,t,n){try{const o=c.exec(e,t),r=[];o.forEach(d,r),n(null,r)}catch(e){n(e)}},get(e,t,n){try{const o=c.exec(e+" LIMIT 1",t),r=[];o.forEach(d,r),n(null,r.shift()||null)}catch(e){n(e)}},run(e,t,n){try{n(null,c.run(e,t))}catch(e){n(e)}}});let h=0;t({all:u,get:f,raw:p,query(t){return/\b(?:INSERT|DELETE|UPDATE)\b/i.test(t[0])&&(clearTimeout(h),h=setTimeout(i,e.timeout||250)),m.apply(this,arguments)}})},onerror:n})}),n)}))}));

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

self.sqliteWorker=function(e){"use strict";const t=new WeakMap,n=(e,...n)=>{const{t:o,v:s}=((e,t)=>{const n=[e[0]],o=[];for(let s=0,c=0,l=0,{length:a}=t;c<a;c++)t[c]instanceof r?n[s]+=t[c].v+e[c+1]:(o[l++]=c,n[++s]=e[c+1]);return{t:n,v:o}})(e,n),c=t.get(e)||t.set(e,{}).get(e);return(c[o]||(c[o]=[o])).concat(s.map((e=>n[e])))};function r(e){this.v=e}const o=(e,t)=>(r,...o)=>new Promise(((c,a)=>{r.some(l)&&a(s(new Error("SQLITE_ERROR: SQL injection hazard")));const[i,...u]=n(r,...o);e[t](i.join("?"),u,((e,t)=>{e?a(e):c(t)}))})),s=e=>(e.code="SQLITE_ERROR",e),c=(e,...t)=>new r(function(e){for(var t=e[0],n=1,r=arguments.length;n<r;n++)t+=arguments[n]+e[n];return t}(e,...t)),l=e=>e.includes("?");function a(e){return{all:o(e,"all"),get:o(e,"get"),query:o(e,"run"),raw:c}}const{assign:i}=Object,u="function"==typeof importScripts,d=u?".":(document.currentScript&&document.currentScript.src||new URL("tmp.js",document.baseURI).href).replace(/\/[^/]*$/,""),m=t=>new Promise((n=>{const r=()=>{const e=self.module.exports;delete self.exports,self.module=void 0,n(e)};if(self.exports={},self.module={exports:e},u)importScripts(t),r();else{const{head:e}=document;i(e.appendChild(document.createElement("script")),{onload(){e.removeChild(this),r()},src:t})}})),p="sqlite",f="buffer",h=(e,t=1)=>new Promise(((n,r)=>{i(indexedDB.open(e,t),{onupgradeneeded({target:{result:e,transaction:t}}){e.objectStoreNames.contains(p)||e.createObjectStore(p).createIndex(f,f,{unique:!0}),i(t,{oncomplete(){n(e)}})},onsuccess({target:{result:e}}){n(e)},onerror:r})}));function w({columns:e,values:t}){for(let{length:n}=t,r=0;r<n;r++){const n=t[r],o={};for(let{length:t}=e,r=0;r<t;r++)o[e[r]]=n[r];this.push(o)}}return(e={})=>new Promise(((t,n)=>{const r=e.dist||d;m(r+"/sql-wasm.js").then((({default:o})=>{Promise.all([h(e.name||"sqlite-worker"),o({locateFile:e=>r+"/"+e})]).then((([r,{Database:o}])=>{const s=e=>r.transaction([p],e).objectStore(p);i(s("readonly").get(f),{onsuccess(){let n=Promise.resolve();const{result:r}=this,c=new o(r||e.database||new Uint8Array(0)),l=()=>{n=n.then((()=>new Promise(((t,n)=>{const r=c.export();i(s("readwrite").put(r,f).transaction,{oncomplete(){t(),e.update&&e.update(r)},onabort:n,onerror:n})}))))};r||l();const{all:u,get:d,query:m,raw:p}=a({all(e,t,n){try{const r=c.exec(e,t),o=[];r.forEach(w,o),n(null,o)}catch(e){n(e)}},get(e,t,n){try{const r=c.exec(e+" LIMIT 1",t),o=[];r.forEach(w,o),n(null,o.shift()||null)}catch(e){n(e)}},run(e,t,n){try{n(null,c.run(e,t))}catch(e){n(e)}}});let h=0;t({all:u,get:d,raw:p,query(t){return/\b(?:INSERT|DELETE|UPDATE)\b/i.test(t[0])&&(clearTimeout(h),h=setTimeout(l,e.timeout||250)),m.apply(this,arguments)}})},onerror:n})}),n)}))}))}({});
self.sqliteWorker=function(e){"use strict";const t=new WeakMap,n=(e,...n)=>{const{t:o,v:s}=((e,t)=>{const n=[e[0]],o=[];for(let s=0,c=0,l=0,{length:a}=t;c<a;c++)t[c]instanceof r?n[s]+=t[c].v+e[c+1]:(o[l++]=c,n[++s]=e[c+1]);return{t:n,v:o}})(e,n),c=t.get(e)||t.set(e,{}).get(e);return(c[o]||(c[o]=[o])).concat(s.map((e=>n[e])))};function r(e){this.v=e}const o=(e,t)=>(r,...o)=>new Promise(((c,a)=>{r.some(l)&&a(s(new Error("SQLITE_ERROR: SQL injection hazard")));const[i,...u]=n(r,...o);e[t](i.join("?"),u,((e,t)=>{e?a(e):c(t)}))})),s=e=>(e.code="SQLITE_ERROR",e),c=(e,...t)=>new r(function(e){for(var t=e[0],n=1,r=arguments.length;n<r;n++)t+=arguments[n]+e[n];return t}(e,...t)),l=e=>e.includes("?");function a(e){return{all:o(e,"all"),get:o(e,"get"),query:o(e,"run"),raw:c}}const{assign:i}=Object,u="function"==typeof importScripts,d=u?".":(document.currentScript&&document.currentScript.src||new URL("tmp.js",document.baseURI).href).replace(/\/[^/]*$/,""),m=t=>new Promise(((n,r)=>{const o=()=>{const e=self.module.exports;delete self.exports,self.module=void 0,n(e)};if(self.exports={},self.module={exports:e},u)importScripts(t),o();else{const{head:e}=document;i(e.appendChild(document.createElement("script")),{onload(){e.removeChild(this),o()},onerror:r,src:t})}})),p="sqlite",f="buffer",h=(e,t=1)=>new Promise(((n,r)=>{i(indexedDB.open(e,t),{onupgradeneeded({target:{result:e,transaction:t}}){e.objectStoreNames.contains(p)||e.createObjectStore(p).createIndex(f,f,{unique:!0}),i(t,{oncomplete(){n(e)}})},onsuccess({target:{result:e}}){n(e)},onerror:r})}));function w({columns:e,values:t}){for(let{length:n}=t,r=0;r<n;r++){const n=t[r],o={};for(let{length:t}=e,r=0;r<t;r++)o[e[r]]=n[r];this.push(o)}}return(e={})=>new Promise(((t,n)=>{const r=e.dist||d;m(r+"/sql-wasm.js").then((({default:o})=>{Promise.all([h(e.name||"sqlite-worker"),o({locateFile:e=>r+"/"+e})]).then((([r,{Database:o}])=>{const s=e=>r.transaction([p],e).objectStore(p);i(s("readonly").get(f),{onsuccess(){let n=Promise.resolve();const{result:r}=this,c=new o(r||e.database||new Uint8Array(0)),l=()=>{n=n.then((()=>new Promise(((t,n)=>{const r=c.export();i(s("readwrite").put(r,f).transaction,{oncomplete(){t(),e.update&&e.update(r)},onabort:n,onerror:n})}))))};r||l();const{all:u,get:d,query:m,raw:p}=a({all(e,t,n){try{const r=c.exec(e,t),o=[];r.forEach(w,o),n(null,o)}catch(e){n(e)}},get(e,t,n){try{const r=c.exec(e+" LIMIT 1",t),o=[];r.forEach(w,o),n(null,o.shift()||null)}catch(e){n(e)}},run(e,t,n){try{n(null,c.run(e,t))}catch(e){n(e)}}});let h=0;t({all:u,get:d,raw:p,query(t){return/\b(?:INSERT|DELETE|UPDATE)\b/i.test(t[0])&&(clearTimeout(h),h=setTimeout(l,e.timeout||250)),m.apply(this,arguments)}})},onerror:n})}),n)}))}))}({});

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

!function(){"use strict";const{assign:e}=Object,t="function"==typeof importScripts,s=s=>new Promise((r=>{const o=()=>{const e=self.module.exports;delete self.exports,self.module=void 0,r(e)};if(self.exports={},self.module={exports:exports},t)importScripts(s),o();else{const{head:t}=document;e(t.appendChild(document.createElement("script")),{onload(){t.removeChild(this),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,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)}}))}();

@@ -9,3 +9,3 @@ const {assign} = Object;

// https://stackoverflow.com/questions/44118600/web-workers-how-to-import-modules/45578811#45578811
export const load = src => new Promise(resolve => {
export const load = src => new Promise((resolve, onerror) => {
const onload = () => {

@@ -35,2 +35,3 @@ const module = self.module.exports;

},
onerror,
src

@@ -37,0 +38,0 @@ }

{
"name": "sqlite-worker",
"version": "0.4.2",
"version": "0.4.3",
"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