@unvired/cordova-plugin-unvired-electron-db 0.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,231 @@
1
+ /*
2
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
3
+ * This devtool is neither made for production nor for readable output files.
4
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
5
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
6
+ * or disable the default devtool with "devtool: false".
7
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
8
+ */
9
+ /******/ (() => { // webpackBootstrap
10
+ /******/ "use strict";
11
+ /******/ var __webpack_modules__ = ({
12
+
13
+ /***/ "./src/index.worker.js":
14
+ /*!*****************************!*\
15
+ !*** ./src/index.worker.js ***!
16
+ \*****************************/
17
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
18
+
19
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var comlink__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! comlink */ \"./node_modules/comlink/dist/esm/comlink.mjs\");\n\n\nfunction saveWebDb(appName, arraybuff, storeName = 'appData') {\n\n return new Promise((resolve, reject) => {\n\n let start = performance.now();\n\n var db;\n var request = indexedDB.open(appName);\n request.onupgradeneeded = function (event) {\n db = event.target.result;\n var objectStore = db.createObjectStore(storeName, { keyPath: \"id\" });\n console.log('DB Upgrade needed.')\n reject(\"DB Upgrade needed: \" + event)\n };\n request.onerror = function (event) {\n console.error(\"The database failed to open: \" + event);\n reject(\"The database failed to open: \" + event)\n };\n request.onsuccess = function (event) {\n db = request.result;\n\n db.onversionchange = function() {\n console.log('Unvired Service Worker: Received version change event, we would also this receive event when an attempt is made to delete the database. Closing the database connection in order to facilitate the process.')\n db.close()\n }\n\n db.transaction([storeName], \"readwrite\").objectStore(storeName).delete(1);\n if (!db.objectStoreNames.contains(storeName)) {\n objectStore = db.createObjectStore(storeName, { keyPath: \"id\" });\n }\n var transRequest = db\n .transaction([storeName], \"readwrite\")\n .objectStore(storeName)\n .add({ id: 1, data: arraybuff });\n\n transRequest.onsuccess = function (event) {\n console.log(\"The data has been written successfully\");\n let timeTaken = performance.now() - start;\n console.log(\"Worker - Total time taken : \" + timeTaken + \" milliseconds\");\n resolve()\n };\n transRequest.onerror = function (event) {\n console.error(\"Failed to write data: \" + event);\n reject(\"Failed to write data: \" + event)\n };\n };\n })\n};\n\nconst api = { saveWebDb };\n(0,comlink__WEBPACK_IMPORTED_MODULE_0__.expose)(api)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// import initSqlJs from '@jlongster/sql.js';\n// import { SQLiteFS } from 'absurd-sql';\n// import IndexedDBBackend from 'absurd-sql/dist/indexeddb-backend';\n// import { expose } from \"comlink\";\n\n// self.db = null;\n\n// //Initialize db\n// async function init() {\n// let SQL = await initSqlJs({ locateFile: file => file });\n// let sqlFS = new SQLiteFS(SQL.FS, new IndexedDBBackend());\n// SQL.register_for_idb(sqlFS);\n\n// SQL.FS.mkdir('/sql');\n// SQL.FS.mount(sqlFS, {}, '/sql');\n\n// self.db = new SQL.Database('/sql/db.sqlite', { filename: true });\n// self.db.exec(`\n// PRAGMA page_size=8192;\n// PRAGMA journal_mode=MEMORY;\n// `);\n// }\n\n// // Execute query without return result\n// async function execute(query) {\n// try {\n// self.db.run(query);\n// // self.db.exec(query);\n// } catch (e) {\n// console.log('SQL Error - execute- :' + e)\n// }\n// }\n\n// //Execute query and return results\n// async function executeQuery(query) {\n// let rows = []\n// try {\n// if (!self.db) {\n// console.log('App DB not initialized yet. Call this api after sometime.')\n// return rows\n// }\n\n// var stmt = self.db.prepare(query);\n// while (stmt.step()) {\n// var row = stmt.getAsObject();\n// rows.push(row);\n// }\n// stmt.free();\n// } catch (e) {\n// console.log('SQL Error: - executeQuery -: ' + e)\n// }\n// return rows;\n// }\n\n// //Execute bind query without return result\n// async function executeBindQuery(query, value) {\n// try {\n// self.db.run(query, value);\n// } catch (e) {\n// console.log('SQL Error - executeBindQuery- :' + e)\n// }\n// }\n\n// async function exportDb() {\n// return self.db.export();\n// }\n\n// const api = { init, execute, executeQuery, executeBindQuery, exportDb };\n\n// expose(api)\n\n\n\n\n\n// import initSqlJs from '@jlongster/sql.js';\n// import { SQLiteFS } from 'absurd-sql';\n// import IndexedDBBackend from 'absurd-sql/dist/indexeddb-backend';\n\n// async function init() {\n// let SQL = await initSqlJs({ locateFile: file => file });\n// let sqlFS = new SQLiteFS(SQL.FS, new IndexedDBBackend());\n// SQL.register_for_idb(sqlFS);\n\n// SQL.FS.mkdir('/sql');\n// SQL.FS.mount(sqlFS, {}, '/sql');\n\n// let db = new SQL.Database('/sql/db.sqlite', { filename: true });\n// db.exec(`\n// PRAGMA page_size=8192;\n// PRAGMA journal_mode=MEMORY;\n// `);\n// return db;\n// }\n\n// async function runQueries() {\n// let db = await init();\n\n// try {\n// db.exec('CREATE TABLE kv (key TEXT PRIMARY KEY, value TEXT)');\n// } catch (e) {}\n\n// db.exec('BEGIN TRANSACTION');\n// let stmt = db.prepare('INSERT OR REPLACE INTO kv (key, value) VALUES (?, ?)');\n// for (let i = 0; i < 5; i++) {\n// stmt.run([i, ((Math.random() * 100) | 0).toString()]);\n// }\n// stmt.free();\n// db.exec('COMMIT');\n\n// stmt = db.prepare(`SELECT SUM(value) FROM kv`);\n// stmt.step();\n// console.log('Result:', stmt.getAsObject());\n// stmt.free();\n// }\n\n// runQueries();\n\n\n\n//# sourceURL=webpack://unvired-db-worker/./src/index.worker.js?");
20
+
21
+ /***/ })
22
+
23
+ /******/ });
24
+ /************************************************************************/
25
+ /******/ // The module cache
26
+ /******/ var __webpack_module_cache__ = {};
27
+ /******/
28
+ /******/ // The require function
29
+ /******/ function __webpack_require__(moduleId) {
30
+ /******/ // Check if module is in cache
31
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
32
+ /******/ if (cachedModule !== undefined) {
33
+ /******/ return cachedModule.exports;
34
+ /******/ }
35
+ /******/ // Create a new module (and put it into the cache)
36
+ /******/ var module = __webpack_module_cache__[moduleId] = {
37
+ /******/ // no module.id needed
38
+ /******/ // no module.loaded needed
39
+ /******/ exports: {}
40
+ /******/ };
41
+ /******/
42
+ /******/ // Execute the module function
43
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
44
+ /******/
45
+ /******/ // Return the exports of the module
46
+ /******/ return module.exports;
47
+ /******/ }
48
+ /******/
49
+ /******/ // expose the modules object (__webpack_modules__)
50
+ /******/ __webpack_require__.m = __webpack_modules__;
51
+ /******/
52
+ /******/ // the startup function
53
+ /******/ __webpack_require__.x = () => {
54
+ /******/ // Load entry module and return exports
55
+ /******/ // This entry module depends on other loaded chunks and execution need to be delayed
56
+ /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["vendors-node_modules_comlink_dist_esm_comlink_mjs"], () => (__webpack_require__("./src/index.worker.js")))
57
+ /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
58
+ /******/ return __webpack_exports__;
59
+ /******/ };
60
+ /******/
61
+ /************************************************************************/
62
+ /******/ /* webpack/runtime/chunk loaded */
63
+ /******/ (() => {
64
+ /******/ var deferred = [];
65
+ /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
66
+ /******/ if(chunkIds) {
67
+ /******/ priority = priority || 0;
68
+ /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
69
+ /******/ deferred[i] = [chunkIds, fn, priority];
70
+ /******/ return;
71
+ /******/ }
72
+ /******/ var notFulfilled = Infinity;
73
+ /******/ for (var i = 0; i < deferred.length; i++) {
74
+ /******/ var [chunkIds, fn, priority] = deferred[i];
75
+ /******/ var fulfilled = true;
76
+ /******/ for (var j = 0; j < chunkIds.length; j++) {
77
+ /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
78
+ /******/ chunkIds.splice(j--, 1);
79
+ /******/ } else {
80
+ /******/ fulfilled = false;
81
+ /******/ if(priority < notFulfilled) notFulfilled = priority;
82
+ /******/ }
83
+ /******/ }
84
+ /******/ if(fulfilled) {
85
+ /******/ deferred.splice(i--, 1)
86
+ /******/ var r = fn();
87
+ /******/ if (r !== undefined) result = r;
88
+ /******/ }
89
+ /******/ }
90
+ /******/ return result;
91
+ /******/ };
92
+ /******/ })();
93
+ /******/
94
+ /******/ /* webpack/runtime/define property getters */
95
+ /******/ (() => {
96
+ /******/ // define getter functions for harmony exports
97
+ /******/ __webpack_require__.d = (exports, definition) => {
98
+ /******/ for(var key in definition) {
99
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
100
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
101
+ /******/ }
102
+ /******/ }
103
+ /******/ };
104
+ /******/ })();
105
+ /******/
106
+ /******/ /* webpack/runtime/ensure chunk */
107
+ /******/ (() => {
108
+ /******/ __webpack_require__.f = {};
109
+ /******/ // This file contains only the entry chunk.
110
+ /******/ // The chunk loading function for additional chunks
111
+ /******/ __webpack_require__.e = (chunkId) => {
112
+ /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
113
+ /******/ __webpack_require__.f[key](chunkId, promises);
114
+ /******/ return promises;
115
+ /******/ }, []));
116
+ /******/ };
117
+ /******/ })();
118
+ /******/
119
+ /******/ /* webpack/runtime/get javascript chunk filename */
120
+ /******/ (() => {
121
+ /******/ // This function allow to reference async chunks and sibling chunks for the entrypoint
122
+ /******/ __webpack_require__.u = (chunkId) => {
123
+ /******/ // return url for filenames based on template
124
+ /******/ return "" + chunkId + ".unvired-db-worker.js";
125
+ /******/ };
126
+ /******/ })();
127
+ /******/
128
+ /******/ /* webpack/runtime/global */
129
+ /******/ (() => {
130
+ /******/ __webpack_require__.g = (function() {
131
+ /******/ if (typeof globalThis === 'object') return globalThis;
132
+ /******/ try {
133
+ /******/ return this || new Function('return this')();
134
+ /******/ } catch (e) {
135
+ /******/ if (typeof window === 'object') return window;
136
+ /******/ }
137
+ /******/ })();
138
+ /******/ })();
139
+ /******/
140
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
141
+ /******/ (() => {
142
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
143
+ /******/ })();
144
+ /******/
145
+ /******/ /* webpack/runtime/make namespace object */
146
+ /******/ (() => {
147
+ /******/ // define __esModule on exports
148
+ /******/ __webpack_require__.r = (exports) => {
149
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
150
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
151
+ /******/ }
152
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
153
+ /******/ };
154
+ /******/ })();
155
+ /******/
156
+ /******/ /* webpack/runtime/publicPath */
157
+ /******/ (() => {
158
+ /******/ var scriptUrl;
159
+ /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
160
+ /******/ var document = __webpack_require__.g.document;
161
+ /******/ if (!scriptUrl && document) {
162
+ /******/ if (document.currentScript)
163
+ /******/ scriptUrl = document.currentScript.src
164
+ /******/ if (!scriptUrl) {
165
+ /******/ var scripts = document.getElementsByTagName("script");
166
+ /******/ if(scripts.length) scriptUrl = scripts[scripts.length - 1].src
167
+ /******/ }
168
+ /******/ }
169
+ /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
170
+ /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
171
+ /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
172
+ /******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
173
+ /******/ __webpack_require__.p = scriptUrl;
174
+ /******/ })();
175
+ /******/
176
+ /******/ /* webpack/runtime/importScripts chunk loading */
177
+ /******/ (() => {
178
+ /******/ // no baseURI
179
+ /******/
180
+ /******/ // object to store loaded chunks
181
+ /******/ // "1" means "already loaded"
182
+ /******/ var installedChunks = {
183
+ /******/ "src_index_worker_js": 1
184
+ /******/ };
185
+ /******/
186
+ /******/ // importScripts chunk loading
187
+ /******/ var installChunk = (data) => {
188
+ /******/ var [chunkIds, moreModules, runtime] = data;
189
+ /******/ for(var moduleId in moreModules) {
190
+ /******/ if(__webpack_require__.o(moreModules, moduleId)) {
191
+ /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
192
+ /******/ }
193
+ /******/ }
194
+ /******/ if(runtime) runtime(__webpack_require__);
195
+ /******/ while(chunkIds.length)
196
+ /******/ installedChunks[chunkIds.pop()] = 1;
197
+ /******/ parentChunkLoadingFunction(data);
198
+ /******/ };
199
+ /******/ __webpack_require__.f.i = (chunkId, promises) => {
200
+ /******/ // "1" is the signal for "already loaded"
201
+ /******/ if(!installedChunks[chunkId]) {
202
+ /******/ if(true) { // all chunks have JS
203
+ /******/ importScripts(__webpack_require__.p + __webpack_require__.u(chunkId));
204
+ /******/ }
205
+ /******/ }
206
+ /******/ };
207
+ /******/
208
+ /******/ var chunkLoadingGlobal = self["webpackChunkunvired_db_worker"] = self["webpackChunkunvired_db_worker"] || [];
209
+ /******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);
210
+ /******/ chunkLoadingGlobal.push = installChunk;
211
+ /******/
212
+ /******/ // no HMR
213
+ /******/
214
+ /******/ // no HMR manifest
215
+ /******/ })();
216
+ /******/
217
+ /******/ /* webpack/runtime/startup chunk dependencies */
218
+ /******/ (() => {
219
+ /******/ var next = __webpack_require__.x;
220
+ /******/ __webpack_require__.x = () => {
221
+ /******/ return __webpack_require__.e("vendors-node_modules_comlink_dist_esm_comlink_mjs").then(next);
222
+ /******/ };
223
+ /******/ })();
224
+ /******/
225
+ /************************************************************************/
226
+ /******/
227
+ /******/ // run startup
228
+ /******/ var __webpack_exports__ = __webpack_require__.x();
229
+ /******/
230
+ /******/ })()
231
+ ;
@@ -0,0 +1,166 @@
1
+ /*
2
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
3
+ * This devtool is neither made for production nor for readable output files.
4
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
5
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
6
+ * or disable the default devtool with "devtool: false".
7
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
8
+ */
9
+ /******/ (() => { // webpackBootstrap
10
+ /******/ "use strict";
11
+ /******/ var __webpack_modules__ = ({
12
+
13
+ /***/ "./src/index.js":
14
+ /*!**********************!*\
15
+ !*** ./src/index.js ***!
16
+ \**********************/
17
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
18
+
19
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var comlink__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! comlink */ \"./node_modules/comlink/dist/esm/comlink.mjs\");\n\n\nasync function init_db_worker() {\n let worker = new Worker(new URL(/* worker import */ __webpack_require__.p + __webpack_require__.u(\"src_index_worker_js\"), __webpack_require__.b));\n const api = (0,comlink__WEBPACK_IMPORTED_MODULE_0__.wrap)(worker);\n window.unvired_db_worker = api;\n}\n\ninit_db_worker();\n\n\n//# sourceURL=webpack://unvired-db-worker/./src/index.js?");
20
+
21
+ /***/ }),
22
+
23
+ /***/ "./node_modules/comlink/dist/esm/comlink.mjs":
24
+ /*!***************************************************!*\
25
+ !*** ./node_modules/comlink/dist/esm/comlink.mjs ***!
26
+ \***************************************************/
27
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
28
+
29
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"createEndpoint\": () => (/* binding */ createEndpoint),\n/* harmony export */ \"expose\": () => (/* binding */ expose),\n/* harmony export */ \"proxy\": () => (/* binding */ proxy),\n/* harmony export */ \"proxyMarker\": () => (/* binding */ proxyMarker),\n/* harmony export */ \"releaseProxy\": () => (/* binding */ releaseProxy),\n/* harmony export */ \"transfer\": () => (/* binding */ transfer),\n/* harmony export */ \"transferHandlers\": () => (/* binding */ transferHandlers),\n/* harmony export */ \"windowEndpoint\": () => (/* binding */ windowEndpoint),\n/* harmony export */ \"wrap\": () => (/* binding */ wrap)\n/* harmony export */ });\n/**\r\n * Copyright 2019 Google Inc. All Rights Reserved.\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst proxyMarker = Symbol(\"Comlink.proxy\");\r\nconst createEndpoint = Symbol(\"Comlink.endpoint\");\r\nconst releaseProxy = Symbol(\"Comlink.releaseProxy\");\r\nconst throwMarker = Symbol(\"Comlink.thrown\");\r\nconst isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\r\n/**\r\n * Internal transfer handle to handle objects marked to proxy.\r\n */\r\nconst proxyTransferHandler = {\r\n canHandle: (val) => isObject(val) && val[proxyMarker],\r\n serialize(obj) {\r\n const { port1, port2 } = new MessageChannel();\r\n expose(obj, port1);\r\n return [port2, [port2]];\r\n },\r\n deserialize(port) {\r\n port.start();\r\n return wrap(port);\r\n },\r\n};\r\n/**\r\n * Internal transfer handler to handle thrown exceptions.\r\n */\r\nconst throwTransferHandler = {\r\n canHandle: (value) => isObject(value) && throwMarker in value,\r\n serialize({ value }) {\r\n let serialized;\r\n if (value instanceof Error) {\r\n serialized = {\r\n isError: true,\r\n value: {\r\n message: value.message,\r\n name: value.name,\r\n stack: value.stack,\r\n },\r\n };\r\n }\r\n else {\r\n serialized = { isError: false, value };\r\n }\r\n return [serialized, []];\r\n },\r\n deserialize(serialized) {\r\n if (serialized.isError) {\r\n throw Object.assign(new Error(serialized.value.message), serialized.value);\r\n }\r\n throw serialized.value;\r\n },\r\n};\r\n/**\r\n * Allows customizing the serialization of certain values.\r\n */\r\nconst transferHandlers = new Map([\r\n [\"proxy\", proxyTransferHandler],\r\n [\"throw\", throwTransferHandler],\r\n]);\r\nfunction expose(obj, ep = self) {\r\n ep.addEventListener(\"message\", function callback(ev) {\r\n if (!ev || !ev.data) {\r\n return;\r\n }\r\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\r\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\r\n let returnValue;\r\n try {\r\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\r\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\r\n switch (type) {\r\n case \"GET\" /* GET */:\r\n {\r\n returnValue = rawValue;\r\n }\r\n break;\r\n case \"SET\" /* SET */:\r\n {\r\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\r\n returnValue = true;\r\n }\r\n break;\r\n case \"APPLY\" /* APPLY */:\r\n {\r\n returnValue = rawValue.apply(parent, argumentList);\r\n }\r\n break;\r\n case \"CONSTRUCT\" /* CONSTRUCT */:\r\n {\r\n const value = new rawValue(...argumentList);\r\n returnValue = proxy(value);\r\n }\r\n break;\r\n case \"ENDPOINT\" /* ENDPOINT */:\r\n {\r\n const { port1, port2 } = new MessageChannel();\r\n expose(obj, port2);\r\n returnValue = transfer(port1, [port1]);\r\n }\r\n break;\r\n case \"RELEASE\" /* RELEASE */:\r\n {\r\n returnValue = undefined;\r\n }\r\n break;\r\n default:\r\n return;\r\n }\r\n }\r\n catch (value) {\r\n returnValue = { value, [throwMarker]: 0 };\r\n }\r\n Promise.resolve(returnValue)\r\n .catch((value) => {\r\n return { value, [throwMarker]: 0 };\r\n })\r\n .then((returnValue) => {\r\n const [wireValue, transferables] = toWireValue(returnValue);\r\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\r\n if (type === \"RELEASE\" /* RELEASE */) {\r\n // detach and deactive after sending release response above.\r\n ep.removeEventListener(\"message\", callback);\r\n closeEndPoint(ep);\r\n }\r\n });\r\n });\r\n if (ep.start) {\r\n ep.start();\r\n }\r\n}\r\nfunction isMessagePort(endpoint) {\r\n return endpoint.constructor.name === \"MessagePort\";\r\n}\r\nfunction closeEndPoint(endpoint) {\r\n if (isMessagePort(endpoint))\r\n endpoint.close();\r\n}\r\nfunction wrap(ep, target) {\r\n return createProxy(ep, [], target);\r\n}\r\nfunction throwIfProxyReleased(isReleased) {\r\n if (isReleased) {\r\n throw new Error(\"Proxy has been released and is not useable\");\r\n }\r\n}\r\nfunction createProxy(ep, path = [], target = function () { }) {\r\n let isProxyReleased = false;\r\n const proxy = new Proxy(target, {\r\n get(_target, prop) {\r\n throwIfProxyReleased(isProxyReleased);\r\n if (prop === releaseProxy) {\r\n return () => {\r\n return requestResponseMessage(ep, {\r\n type: \"RELEASE\" /* RELEASE */,\r\n path: path.map((p) => p.toString()),\r\n }).then(() => {\r\n closeEndPoint(ep);\r\n isProxyReleased = true;\r\n });\r\n };\r\n }\r\n if (prop === \"then\") {\r\n if (path.length === 0) {\r\n return { then: () => proxy };\r\n }\r\n const r = requestResponseMessage(ep, {\r\n type: \"GET\" /* GET */,\r\n path: path.map((p) => p.toString()),\r\n }).then(fromWireValue);\r\n return r.then.bind(r);\r\n }\r\n return createProxy(ep, [...path, prop]);\r\n },\r\n set(_target, prop, rawValue) {\r\n throwIfProxyReleased(isProxyReleased);\r\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\r\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\r\n const [value, transferables] = toWireValue(rawValue);\r\n return requestResponseMessage(ep, {\r\n type: \"SET\" /* SET */,\r\n path: [...path, prop].map((p) => p.toString()),\r\n value,\r\n }, transferables).then(fromWireValue);\r\n },\r\n apply(_target, _thisArg, rawArgumentList) {\r\n throwIfProxyReleased(isProxyReleased);\r\n const last = path[path.length - 1];\r\n if (last === createEndpoint) {\r\n return requestResponseMessage(ep, {\r\n type: \"ENDPOINT\" /* ENDPOINT */,\r\n }).then(fromWireValue);\r\n }\r\n // We just pretend that `bind()` didn’t happen.\r\n if (last === \"bind\") {\r\n return createProxy(ep, path.slice(0, -1));\r\n }\r\n const [argumentList, transferables] = processArguments(rawArgumentList);\r\n return requestResponseMessage(ep, {\r\n type: \"APPLY\" /* APPLY */,\r\n path: path.map((p) => p.toString()),\r\n argumentList,\r\n }, transferables).then(fromWireValue);\r\n },\r\n construct(_target, rawArgumentList) {\r\n throwIfProxyReleased(isProxyReleased);\r\n const [argumentList, transferables] = processArguments(rawArgumentList);\r\n return requestResponseMessage(ep, {\r\n type: \"CONSTRUCT\" /* CONSTRUCT */,\r\n path: path.map((p) => p.toString()),\r\n argumentList,\r\n }, transferables).then(fromWireValue);\r\n },\r\n });\r\n return proxy;\r\n}\r\nfunction myFlat(arr) {\r\n return Array.prototype.concat.apply([], arr);\r\n}\r\nfunction processArguments(argumentList) {\r\n const processed = argumentList.map(toWireValue);\r\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\r\n}\r\nconst transferCache = new WeakMap();\r\nfunction transfer(obj, transfers) {\r\n transferCache.set(obj, transfers);\r\n return obj;\r\n}\r\nfunction proxy(obj) {\r\n return Object.assign(obj, { [proxyMarker]: true });\r\n}\r\nfunction windowEndpoint(w, context = self, targetOrigin = \"*\") {\r\n return {\r\n postMessage: (msg, transferables) => w.postMessage(msg, targetOrigin, transferables),\r\n addEventListener: context.addEventListener.bind(context),\r\n removeEventListener: context.removeEventListener.bind(context),\r\n };\r\n}\r\nfunction toWireValue(value) {\r\n for (const [name, handler] of transferHandlers) {\r\n if (handler.canHandle(value)) {\r\n const [serializedValue, transferables] = handler.serialize(value);\r\n return [\r\n {\r\n type: \"HANDLER\" /* HANDLER */,\r\n name,\r\n value: serializedValue,\r\n },\r\n transferables,\r\n ];\r\n }\r\n }\r\n return [\r\n {\r\n type: \"RAW\" /* RAW */,\r\n value,\r\n },\r\n transferCache.get(value) || [],\r\n ];\r\n}\r\nfunction fromWireValue(value) {\r\n switch (value.type) {\r\n case \"HANDLER\" /* HANDLER */:\r\n return transferHandlers.get(value.name).deserialize(value.value);\r\n case \"RAW\" /* RAW */:\r\n return value.value;\r\n }\r\n}\r\nfunction requestResponseMessage(ep, msg, transfers) {\r\n return new Promise((resolve) => {\r\n const id = generateUUID();\r\n ep.addEventListener(\"message\", function l(ev) {\r\n if (!ev.data || !ev.data.id || ev.data.id !== id) {\r\n return;\r\n }\r\n ep.removeEventListener(\"message\", l);\r\n resolve(ev.data);\r\n });\r\n if (ep.start) {\r\n ep.start();\r\n }\r\n ep.postMessage(Object.assign({ id }, msg), transfers);\r\n });\r\n}\r\nfunction generateUUID() {\r\n return new Array(4)\r\n .fill(0)\r\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\r\n .join(\"-\");\r\n}\n\n\n//# sourceMappingURL=comlink.mjs.map\n\n\n//# sourceURL=webpack://unvired-db-worker/./node_modules/comlink/dist/esm/comlink.mjs?");
30
+
31
+ /***/ })
32
+
33
+ /******/ });
34
+ /************************************************************************/
35
+ /******/ // The module cache
36
+ /******/ var __webpack_module_cache__ = {};
37
+ /******/
38
+ /******/ // The require function
39
+ /******/ function __webpack_require__(moduleId) {
40
+ /******/ // Check if module is in cache
41
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
42
+ /******/ if (cachedModule !== undefined) {
43
+ /******/ return cachedModule.exports;
44
+ /******/ }
45
+ /******/ // Create a new module (and put it into the cache)
46
+ /******/ var module = __webpack_module_cache__[moduleId] = {
47
+ /******/ // no module.id needed
48
+ /******/ // no module.loaded needed
49
+ /******/ exports: {}
50
+ /******/ };
51
+ /******/
52
+ /******/ // Execute the module function
53
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
54
+ /******/
55
+ /******/ // Return the exports of the module
56
+ /******/ return module.exports;
57
+ /******/ }
58
+ /******/
59
+ /******/ // expose the modules object (__webpack_modules__)
60
+ /******/ __webpack_require__.m = __webpack_modules__;
61
+ /******/
62
+ /************************************************************************/
63
+ /******/ /* webpack/runtime/define property getters */
64
+ /******/ (() => {
65
+ /******/ // define getter functions for harmony exports
66
+ /******/ __webpack_require__.d = (exports, definition) => {
67
+ /******/ for(var key in definition) {
68
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
69
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
70
+ /******/ }
71
+ /******/ }
72
+ /******/ };
73
+ /******/ })();
74
+ /******/
75
+ /******/ /* webpack/runtime/get javascript chunk filename */
76
+ /******/ (() => {
77
+ /******/ // This function allow to reference async chunks
78
+ /******/ __webpack_require__.u = (chunkId) => {
79
+ /******/ // return url for filenames based on template
80
+ /******/ return "" + chunkId + ".unvired-db-worker.js";
81
+ /******/ };
82
+ /******/ })();
83
+ /******/
84
+ /******/ /* webpack/runtime/global */
85
+ /******/ (() => {
86
+ /******/ __webpack_require__.g = (function() {
87
+ /******/ if (typeof globalThis === 'object') return globalThis;
88
+ /******/ try {
89
+ /******/ return this || new Function('return this')();
90
+ /******/ } catch (e) {
91
+ /******/ if (typeof window === 'object') return window;
92
+ /******/ }
93
+ /******/ })();
94
+ /******/ })();
95
+ /******/
96
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
97
+ /******/ (() => {
98
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
99
+ /******/ })();
100
+ /******/
101
+ /******/ /* webpack/runtime/make namespace object */
102
+ /******/ (() => {
103
+ /******/ // define __esModule on exports
104
+ /******/ __webpack_require__.r = (exports) => {
105
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
106
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
107
+ /******/ }
108
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
109
+ /******/ };
110
+ /******/ })();
111
+ /******/
112
+ /******/ /* webpack/runtime/publicPath */
113
+ /******/ (() => {
114
+ /******/ var scriptUrl;
115
+ /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
116
+ /******/ var document = __webpack_require__.g.document;
117
+ /******/ if (!scriptUrl && document) {
118
+ /******/ if (document.currentScript)
119
+ /******/ scriptUrl = document.currentScript.src
120
+ /******/ if (!scriptUrl) {
121
+ /******/ var scripts = document.getElementsByTagName("script");
122
+ /******/ if(scripts.length) scriptUrl = scripts[scripts.length - 1].src
123
+ /******/ }
124
+ /******/ }
125
+ /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
126
+ /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
127
+ /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
128
+ /******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
129
+ /******/ __webpack_require__.p = scriptUrl;
130
+ /******/ })();
131
+ /******/
132
+ /******/ /* webpack/runtime/jsonp chunk loading */
133
+ /******/ (() => {
134
+ /******/ __webpack_require__.b = document.baseURI || self.location.href;
135
+ /******/
136
+ /******/ // object to store loaded and loading chunks
137
+ /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
138
+ /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
139
+ /******/ var installedChunks = {
140
+ /******/ "main": 0
141
+ /******/ };
142
+ /******/
143
+ /******/ // no chunk on demand loading
144
+ /******/
145
+ /******/ // no prefetching
146
+ /******/
147
+ /******/ // no preloaded
148
+ /******/
149
+ /******/ // no HMR
150
+ /******/
151
+ /******/ // no HMR manifest
152
+ /******/
153
+ /******/ // no on chunks loaded
154
+ /******/
155
+ /******/ // no jsonp function
156
+ /******/ })();
157
+ /******/
158
+ /************************************************************************/
159
+ /******/
160
+ /******/ // startup
161
+ /******/ // Load entry module and return exports
162
+ /******/ // This entry module can't be inlined because the eval devtool is used.
163
+ /******/ var __webpack_exports__ = __webpack_require__("./src/index.js");
164
+ /******/
165
+ /******/ })()
166
+ ;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /*
3
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
4
+ * This devtool is neither made for production nor for readable output files.
5
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
6
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
7
+ * or disable the default devtool with "devtool: false".
8
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
9
+ */
10
+ (self["webpackChunkunvired_db_worker"] = self["webpackChunkunvired_db_worker"] || []).push([["vendors-node_modules_comlink_dist_esm_comlink_mjs"],{
11
+
12
+ /***/ "./node_modules/comlink/dist/esm/comlink.mjs":
13
+ /*!***************************************************!*\
14
+ !*** ./node_modules/comlink/dist/esm/comlink.mjs ***!
15
+ \***************************************************/
16
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
17
+
18
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"createEndpoint\": () => (/* binding */ createEndpoint),\n/* harmony export */ \"expose\": () => (/* binding */ expose),\n/* harmony export */ \"proxy\": () => (/* binding */ proxy),\n/* harmony export */ \"proxyMarker\": () => (/* binding */ proxyMarker),\n/* harmony export */ \"releaseProxy\": () => (/* binding */ releaseProxy),\n/* harmony export */ \"transfer\": () => (/* binding */ transfer),\n/* harmony export */ \"transferHandlers\": () => (/* binding */ transferHandlers),\n/* harmony export */ \"windowEndpoint\": () => (/* binding */ windowEndpoint),\n/* harmony export */ \"wrap\": () => (/* binding */ wrap)\n/* harmony export */ });\n/**\r\n * Copyright 2019 Google Inc. All Rights Reserved.\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst proxyMarker = Symbol(\"Comlink.proxy\");\r\nconst createEndpoint = Symbol(\"Comlink.endpoint\");\r\nconst releaseProxy = Symbol(\"Comlink.releaseProxy\");\r\nconst throwMarker = Symbol(\"Comlink.thrown\");\r\nconst isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\r\n/**\r\n * Internal transfer handle to handle objects marked to proxy.\r\n */\r\nconst proxyTransferHandler = {\r\n canHandle: (val) => isObject(val) && val[proxyMarker],\r\n serialize(obj) {\r\n const { port1, port2 } = new MessageChannel();\r\n expose(obj, port1);\r\n return [port2, [port2]];\r\n },\r\n deserialize(port) {\r\n port.start();\r\n return wrap(port);\r\n },\r\n};\r\n/**\r\n * Internal transfer handler to handle thrown exceptions.\r\n */\r\nconst throwTransferHandler = {\r\n canHandle: (value) => isObject(value) && throwMarker in value,\r\n serialize({ value }) {\r\n let serialized;\r\n if (value instanceof Error) {\r\n serialized = {\r\n isError: true,\r\n value: {\r\n message: value.message,\r\n name: value.name,\r\n stack: value.stack,\r\n },\r\n };\r\n }\r\n else {\r\n serialized = { isError: false, value };\r\n }\r\n return [serialized, []];\r\n },\r\n deserialize(serialized) {\r\n if (serialized.isError) {\r\n throw Object.assign(new Error(serialized.value.message), serialized.value);\r\n }\r\n throw serialized.value;\r\n },\r\n};\r\n/**\r\n * Allows customizing the serialization of certain values.\r\n */\r\nconst transferHandlers = new Map([\r\n [\"proxy\", proxyTransferHandler],\r\n [\"throw\", throwTransferHandler],\r\n]);\r\nfunction expose(obj, ep = self) {\r\n ep.addEventListener(\"message\", function callback(ev) {\r\n if (!ev || !ev.data) {\r\n return;\r\n }\r\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\r\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\r\n let returnValue;\r\n try {\r\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\r\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\r\n switch (type) {\r\n case \"GET\" /* GET */:\r\n {\r\n returnValue = rawValue;\r\n }\r\n break;\r\n case \"SET\" /* SET */:\r\n {\r\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\r\n returnValue = true;\r\n }\r\n break;\r\n case \"APPLY\" /* APPLY */:\r\n {\r\n returnValue = rawValue.apply(parent, argumentList);\r\n }\r\n break;\r\n case \"CONSTRUCT\" /* CONSTRUCT */:\r\n {\r\n const value = new rawValue(...argumentList);\r\n returnValue = proxy(value);\r\n }\r\n break;\r\n case \"ENDPOINT\" /* ENDPOINT */:\r\n {\r\n const { port1, port2 } = new MessageChannel();\r\n expose(obj, port2);\r\n returnValue = transfer(port1, [port1]);\r\n }\r\n break;\r\n case \"RELEASE\" /* RELEASE */:\r\n {\r\n returnValue = undefined;\r\n }\r\n break;\r\n default:\r\n return;\r\n }\r\n }\r\n catch (value) {\r\n returnValue = { value, [throwMarker]: 0 };\r\n }\r\n Promise.resolve(returnValue)\r\n .catch((value) => {\r\n return { value, [throwMarker]: 0 };\r\n })\r\n .then((returnValue) => {\r\n const [wireValue, transferables] = toWireValue(returnValue);\r\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\r\n if (type === \"RELEASE\" /* RELEASE */) {\r\n // detach and deactive after sending release response above.\r\n ep.removeEventListener(\"message\", callback);\r\n closeEndPoint(ep);\r\n }\r\n });\r\n });\r\n if (ep.start) {\r\n ep.start();\r\n }\r\n}\r\nfunction isMessagePort(endpoint) {\r\n return endpoint.constructor.name === \"MessagePort\";\r\n}\r\nfunction closeEndPoint(endpoint) {\r\n if (isMessagePort(endpoint))\r\n endpoint.close();\r\n}\r\nfunction wrap(ep, target) {\r\n return createProxy(ep, [], target);\r\n}\r\nfunction throwIfProxyReleased(isReleased) {\r\n if (isReleased) {\r\n throw new Error(\"Proxy has been released and is not useable\");\r\n }\r\n}\r\nfunction createProxy(ep, path = [], target = function () { }) {\r\n let isProxyReleased = false;\r\n const proxy = new Proxy(target, {\r\n get(_target, prop) {\r\n throwIfProxyReleased(isProxyReleased);\r\n if (prop === releaseProxy) {\r\n return () => {\r\n return requestResponseMessage(ep, {\r\n type: \"RELEASE\" /* RELEASE */,\r\n path: path.map((p) => p.toString()),\r\n }).then(() => {\r\n closeEndPoint(ep);\r\n isProxyReleased = true;\r\n });\r\n };\r\n }\r\n if (prop === \"then\") {\r\n if (path.length === 0) {\r\n return { then: () => proxy };\r\n }\r\n const r = requestResponseMessage(ep, {\r\n type: \"GET\" /* GET */,\r\n path: path.map((p) => p.toString()),\r\n }).then(fromWireValue);\r\n return r.then.bind(r);\r\n }\r\n return createProxy(ep, [...path, prop]);\r\n },\r\n set(_target, prop, rawValue) {\r\n throwIfProxyReleased(isProxyReleased);\r\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\r\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\r\n const [value, transferables] = toWireValue(rawValue);\r\n return requestResponseMessage(ep, {\r\n type: \"SET\" /* SET */,\r\n path: [...path, prop].map((p) => p.toString()),\r\n value,\r\n }, transferables).then(fromWireValue);\r\n },\r\n apply(_target, _thisArg, rawArgumentList) {\r\n throwIfProxyReleased(isProxyReleased);\r\n const last = path[path.length - 1];\r\n if (last === createEndpoint) {\r\n return requestResponseMessage(ep, {\r\n type: \"ENDPOINT\" /* ENDPOINT */,\r\n }).then(fromWireValue);\r\n }\r\n // We just pretend that `bind()` didn’t happen.\r\n if (last === \"bind\") {\r\n return createProxy(ep, path.slice(0, -1));\r\n }\r\n const [argumentList, transferables] = processArguments(rawArgumentList);\r\n return requestResponseMessage(ep, {\r\n type: \"APPLY\" /* APPLY */,\r\n path: path.map((p) => p.toString()),\r\n argumentList,\r\n }, transferables).then(fromWireValue);\r\n },\r\n construct(_target, rawArgumentList) {\r\n throwIfProxyReleased(isProxyReleased);\r\n const [argumentList, transferables] = processArguments(rawArgumentList);\r\n return requestResponseMessage(ep, {\r\n type: \"CONSTRUCT\" /* CONSTRUCT */,\r\n path: path.map((p) => p.toString()),\r\n argumentList,\r\n }, transferables).then(fromWireValue);\r\n },\r\n });\r\n return proxy;\r\n}\r\nfunction myFlat(arr) {\r\n return Array.prototype.concat.apply([], arr);\r\n}\r\nfunction processArguments(argumentList) {\r\n const processed = argumentList.map(toWireValue);\r\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\r\n}\r\nconst transferCache = new WeakMap();\r\nfunction transfer(obj, transfers) {\r\n transferCache.set(obj, transfers);\r\n return obj;\r\n}\r\nfunction proxy(obj) {\r\n return Object.assign(obj, { [proxyMarker]: true });\r\n}\r\nfunction windowEndpoint(w, context = self, targetOrigin = \"*\") {\r\n return {\r\n postMessage: (msg, transferables) => w.postMessage(msg, targetOrigin, transferables),\r\n addEventListener: context.addEventListener.bind(context),\r\n removeEventListener: context.removeEventListener.bind(context),\r\n };\r\n}\r\nfunction toWireValue(value) {\r\n for (const [name, handler] of transferHandlers) {\r\n if (handler.canHandle(value)) {\r\n const [serializedValue, transferables] = handler.serialize(value);\r\n return [\r\n {\r\n type: \"HANDLER\" /* HANDLER */,\r\n name,\r\n value: serializedValue,\r\n },\r\n transferables,\r\n ];\r\n }\r\n }\r\n return [\r\n {\r\n type: \"RAW\" /* RAW */,\r\n value,\r\n },\r\n transferCache.get(value) || [],\r\n ];\r\n}\r\nfunction fromWireValue(value) {\r\n switch (value.type) {\r\n case \"HANDLER\" /* HANDLER */:\r\n return transferHandlers.get(value.name).deserialize(value.value);\r\n case \"RAW\" /* RAW */:\r\n return value.value;\r\n }\r\n}\r\nfunction requestResponseMessage(ep, msg, transfers) {\r\n return new Promise((resolve) => {\r\n const id = generateUUID();\r\n ep.addEventListener(\"message\", function l(ev) {\r\n if (!ev.data || !ev.data.id || ev.data.id !== id) {\r\n return;\r\n }\r\n ep.removeEventListener(\"message\", l);\r\n resolve(ev.data);\r\n });\r\n if (ep.start) {\r\n ep.start();\r\n }\r\n ep.postMessage(Object.assign({ id }, msg), transfers);\r\n });\r\n}\r\nfunction generateUUID() {\r\n return new Array(4)\r\n .fill(0)\r\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\r\n .join(\"-\");\r\n}\n\n\n//# sourceMappingURL=comlink.mjs.map\n\n\n//# sourceURL=webpack://unvired-db-worker/./node_modules/comlink/dist/esm/comlink.mjs?");
19
+
20
+ /***/ })
21
+
22
+ }]);
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "cordova-plugin-unvired-electron-db",
3
+ "version": "0.0.36",
4
+ "description": "Unvired DB Native Support for Cordova",
5
+ "main": "unvired-db-proxy.js",
6
+ "author": "Unvired Inc",
7
+ "license": "UNLICENSED",
8
+ "scripts": {
9
+ "postinstall": "install-app-deps"
10
+ },
11
+ "cordova": {
12
+ "serviceName": "UnviredDB"
13
+ },
14
+ "dependencies": {
15
+ "sqlite3": "5.1.6"
16
+ }
17
+ }