@based/db 0.0.66 → 0.0.68
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.
- package/README.md +2 -2
- package/dist/lib/darwin_aarch64/include/selva/colvec.h +71 -0
- package/dist/lib/darwin_aarch64/include/selva/db.h +3 -0
- package/dist/lib/darwin_aarch64/include/selva/fields.h +1 -1
- package/dist/lib/darwin_aarch64/include/selva/types.h +7 -0
- package/dist/lib/darwin_aarch64/libdeflate.dylib +0 -0
- package/dist/lib/darwin_aarch64/libjemalloc_selva.2.dylib +0 -0
- package/dist/lib/darwin_aarch64/libjemalloc_selva.so.2 +0 -0
- package/dist/lib/darwin_aarch64/libnode-v20.node +0 -0
- package/dist/lib/darwin_aarch64/libnode-v21.node +0 -0
- package/dist/lib/darwin_aarch64/libnode-v22.node +0 -0
- package/dist/lib/darwin_aarch64/libnode-v23.node +0 -0
- package/dist/lib/darwin_aarch64/libnode-v24.node +0 -0
- package/dist/lib/darwin_aarch64/libselva.dylib +0 -0
- package/dist/lib/darwin_aarch64/libxxhash.dylib +0 -0
- package/dist/lib/linux_aarch64/include/selva/colvec.h +71 -0
- package/dist/lib/linux_aarch64/include/selva/db.h +3 -0
- package/dist/lib/linux_aarch64/include/selva/fields.h +1 -1
- package/dist/lib/linux_aarch64/include/selva/types.h +7 -0
- package/dist/lib/linux_aarch64/libnode-v20.node +0 -0
- package/dist/lib/linux_aarch64/libnode-v21.node +0 -0
- package/dist/lib/linux_aarch64/libnode-v22.node +0 -0
- package/dist/lib/linux_aarch64/libnode-v23.node +0 -0
- package/dist/lib/linux_aarch64/libnode-v24.node +0 -0
- package/dist/lib/linux_aarch64/libselva.so +0 -0
- package/dist/lib/linux_x86_64/include/selva/colvec.h +71 -0
- package/dist/lib/linux_x86_64/include/selva/db.h +3 -0
- package/dist/lib/linux_x86_64/include/selva/fields.h +1 -1
- package/dist/lib/linux_x86_64/include/selva/types.h +7 -0
- package/dist/lib/linux_x86_64/libnode-v20.node +0 -0
- package/dist/lib/linux_x86_64/libnode-v21.node +0 -0
- package/dist/lib/linux_x86_64/libnode-v22.node +0 -0
- package/dist/lib/linux_x86_64/libnode-v23.node +0 -0
- package/dist/lib/linux_x86_64/libnode-v24.node +0 -0
- package/dist/lib/linux_x86_64/libselva.so +0 -0
- package/dist/src/client/flushModify.d.ts +2 -1
- package/dist/src/client/flushModify.js +12 -4
- package/dist/src/client/modify/create.js +11 -0
- package/dist/src/client/modify/delete.js +3 -0
- package/dist/src/client/modify/modify.js +2 -2
- package/dist/src/client/modify/setCursor.d.ts +2 -1
- package/dist/src/client/query/BasedDbQuery.d.ts +7 -2
- package/dist/src/client/query/BasedDbQuery.js +111 -14
- package/dist/src/client/query/aggregates/aggregation.js +24 -11
- package/dist/src/client/query/aggregates/types.d.ts +21 -2
- package/dist/src/client/query/aggregates/types.js +34 -1
- package/dist/src/client/query/display.js +8 -2
- package/dist/src/client/query/filter/createVariableFilterBuffer.d.ts +2 -3
- package/dist/src/client/query/filter/createVariableFilterBuffer.js +20 -7
- package/dist/src/client/query/filter/filter.js +13 -3
- package/dist/src/client/query/filter/primitiveFilter.d.ts +1 -2
- package/dist/src/client/query/include/props.js +18 -2
- package/dist/src/client/query/include/toBuffer.js +11 -3
- package/dist/src/client/query/include/walk.js +5 -1
- package/dist/src/client/query/queryDef.js +4 -1
- package/dist/src/client/query/read/read.js +50 -23
- package/dist/src/client/query/registerQuery.js +1 -0
- package/dist/src/client/query/search/index.d.ts +1 -1
- package/dist/src/client/query/search/index.js +21 -7
- package/dist/src/client/query/sort.d.ts +1 -1
- package/dist/src/client/query/toByteCode/default.d.ts +1 -1
- package/dist/src/client/query/toByteCode/default.js +0 -2
- package/dist/src/client/query/toByteCode/toBuffer.js +0 -7
- package/dist/src/client/query/types.d.ts +16 -5
- package/dist/src/client/query/validation.js +25 -2
- package/dist/src/client/xxHash64.d.ts +1 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.js +0 -1
- package/dist/src/native.d.ts +2 -2
- package/dist/src/native.js +7 -8
- package/dist/src/server/IoWorker.d.ts +8 -0
- package/dist/src/server/IoWorker.js +39 -0
- package/dist/src/server/QueryWorker.d.ts +8 -0
- package/dist/src/server/QueryWorker.js +26 -0
- package/dist/src/server/blocks.d.ts +24 -0
- package/dist/src/server/blocks.js +112 -0
- package/dist/src/server/dbHash.d.ts +1 -1
- package/dist/src/server/index.d.ts +9 -16
- package/dist/src/server/index.js +37 -15
- package/dist/src/server/migrate/index.d.ts +5 -0
- package/dist/src/server/migrate/index.js +10 -7
- package/dist/src/server/save.d.ts +8 -6
- package/dist/src/server/save.js +34 -78
- package/dist/src/server/schema.js +6 -5
- package/dist/src/server/start.js +57 -60
- package/dist/src/server/tree.d.ts +24 -13
- package/dist/src/server/tree.js +95 -66
- package/dist/src/server/workers/DbWorker.d.ts +17 -0
- package/dist/src/server/{DbWorker.js → workers/DbWorker.js} +15 -17
- package/dist/src/server/workers/io_worker.js +39 -0
- package/dist/src/server/workers/io_worker_types.d.ts +12 -0
- package/dist/src/server/workers/io_worker_types.js +2 -0
- package/dist/src/server/workers/query_worker.d.ts +1 -0
- package/dist/src/server/workers/query_worker.js +4 -0
- package/dist/src/server/workers/worker.d.ts +1 -0
- package/dist/src/server/workers/worker.js +41 -0
- package/dist/src/shared/Emitter.d.ts +1 -0
- package/dist/src/types.d.ts +1 -1
- package/dist/src/types.js +1 -1
- package/package.json +3 -3
- package/dist/lib/darwin_aarch64/include/selva/history.h +0 -64
- package/dist/lib/linux_aarch64/include/selva/history.h +0 -64
- package/dist/lib/linux_x86_64/include/selva/history.h +0 -64
- package/dist/src/client/query/serialize.d.ts +0 -4
- package/dist/src/client/query/serialize.js +0 -26
- package/dist/src/server/DbWorker.d.ts +0 -13
- package/dist/src/server/csmt/draw-dot.d.ts +0 -4
- package/dist/src/server/csmt/draw-dot.js +0 -38
- package/dist/src/server/csmt/index.d.ts +0 -4
- package/dist/src/server/csmt/index.js +0 -5
- package/dist/src/server/csmt/match.d.ts +0 -7
- package/dist/src/server/csmt/match.js +0 -10
- package/dist/src/server/csmt/memebership-proof.d.ts +0 -7
- package/dist/src/server/csmt/memebership-proof.js +0 -122
- package/dist/src/server/csmt/tree-utils.d.ts +0 -6
- package/dist/src/server/csmt/tree-utils.js +0 -33
- package/dist/src/server/csmt/tree.d.ts +0 -3
- package/dist/src/server/csmt/tree.js +0 -270
- package/dist/src/server/csmt/types.d.ts +0 -46
- package/dist/src/server/csmt/types.js +0 -2
- package/dist/src/server/worker.js +0 -33
- /package/dist/src/server/{worker.d.ts → workers/io_worker.d.ts} +0 -0
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
import { TreeKeyNil } from './types.js';
|
|
2
|
-
import { distance, min, max } from './tree-utils.js';
|
|
3
|
-
import membershipProof from './memebership-proof.js';
|
|
4
|
-
import { equals } from '@saulx/utils';
|
|
5
|
-
export function hashEq(a, b) {
|
|
6
|
-
return equals(a, b);
|
|
7
|
-
}
|
|
8
|
-
export function createTree(createHash) {
|
|
9
|
-
let root = null;
|
|
10
|
-
const emptyHash = createHash().digest();
|
|
11
|
-
function genNodeHash(lHash, rHash) {
|
|
12
|
-
return createHash().update(lHash).update(rHash).digest();
|
|
13
|
-
}
|
|
14
|
-
function createNode(left, right) {
|
|
15
|
-
const hash = left && right ? genNodeHash(left.hash, right.hash) : emptyHash;
|
|
16
|
-
return {
|
|
17
|
-
hash,
|
|
18
|
-
key: max(left, right),
|
|
19
|
-
left,
|
|
20
|
-
right,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
function createLeaf(k, h, data) {
|
|
24
|
-
return {
|
|
25
|
-
hash: h,
|
|
26
|
-
key: k,
|
|
27
|
-
data,
|
|
28
|
-
left: null,
|
|
29
|
-
right: null,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Update node properties.
|
|
34
|
-
*/
|
|
35
|
-
function updateNode(node) {
|
|
36
|
-
if (node.left || node.right) {
|
|
37
|
-
node.key = max(node.left, node.right);
|
|
38
|
-
if (node.left && node.right) {
|
|
39
|
-
node.hash = genNodeHash(node.left.hash, node.right.hash);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
function insert(node, newLeaf) {
|
|
44
|
-
const { key: k } = newLeaf;
|
|
45
|
-
let left = node.left;
|
|
46
|
-
let right = node.right;
|
|
47
|
-
// Check if this is a leaf
|
|
48
|
-
if (!left && !right) {
|
|
49
|
-
const nodeKey = node.key;
|
|
50
|
-
if (nodeKey < k) {
|
|
51
|
-
return createNode(node, newLeaf);
|
|
52
|
-
}
|
|
53
|
-
else if (nodeKey > k) {
|
|
54
|
-
return createNode(newLeaf, node);
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
throw new Error(`k=${k} exists`);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
const lDist = distance(k, (left && left.key) || TreeKeyNil);
|
|
61
|
-
const rDist = distance(k, (right && right.key) || TreeKeyNil);
|
|
62
|
-
if (lDist < rDist) {
|
|
63
|
-
node.left = left ? insert(left, newLeaf) : newLeaf;
|
|
64
|
-
}
|
|
65
|
-
else if (lDist > rDist) {
|
|
66
|
-
node.right = right ? insert(right, newLeaf) : newLeaf;
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
return k < min(left, right)
|
|
70
|
-
? createNode(newLeaf, node)
|
|
71
|
-
: createNode(node, newLeaf);
|
|
72
|
-
}
|
|
73
|
-
updateNode(node);
|
|
74
|
-
return node;
|
|
75
|
-
}
|
|
76
|
-
function checkForLeaf(node, k) {
|
|
77
|
-
return !node.left && !node.right && node.key === k;
|
|
78
|
-
}
|
|
79
|
-
function deleteNode(node, k) {
|
|
80
|
-
const left = node.left;
|
|
81
|
-
const right = node.right;
|
|
82
|
-
if (!left || !right) {
|
|
83
|
-
if (node.data) {
|
|
84
|
-
if (node.key === k) {
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
|
-
throw new Error(`k=${k} does not exist`);
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
throw new Error('The tree is broken');
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
if (checkForLeaf(left, k) || checkForLeaf(right, k)) {
|
|
94
|
-
if (left.key === k) {
|
|
95
|
-
// The `left` node is discarded
|
|
96
|
-
return right;
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
// The `right` node is discarded
|
|
100
|
-
return left;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
const lDist = distance(k, left.key);
|
|
105
|
-
const rDist = distance(k, right.key);
|
|
106
|
-
if (lDist < rDist) {
|
|
107
|
-
node.left = deleteNode(left, k);
|
|
108
|
-
updateNode(node);
|
|
109
|
-
return node;
|
|
110
|
-
}
|
|
111
|
-
else if (lDist > rDist) {
|
|
112
|
-
node.right = deleteNode(right, k);
|
|
113
|
-
updateNode(node);
|
|
114
|
-
return node;
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
throw new Error(`k=${k} does not exist`);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
function updateNodeHash(node) {
|
|
122
|
-
if (node.left && node.right) {
|
|
123
|
-
node.hash = genNodeHash(node.left.hash, node.right.hash);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
function updateHash(node, k, hash) {
|
|
127
|
-
if (!node)
|
|
128
|
-
return;
|
|
129
|
-
const { left, right } = node;
|
|
130
|
-
if (k === node.key && !left && !right) {
|
|
131
|
-
node.hash = hash;
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
if (left && left.key === k) {
|
|
135
|
-
updateHash(left, k, hash);
|
|
136
|
-
updateNodeHash(left);
|
|
137
|
-
updateNodeHash(node);
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
if (right && right.key === k) {
|
|
141
|
-
updateHash(right, k, hash);
|
|
142
|
-
updateNodeHash(right);
|
|
143
|
-
updateNodeHash(node);
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
const lDist = distance(k, (left && left.key) || TreeKeyNil);
|
|
147
|
-
const rDist = distance(k, (right && right.key) || TreeKeyNil);
|
|
148
|
-
if (left && lDist <= rDist) {
|
|
149
|
-
updateHash(left, k, hash);
|
|
150
|
-
updateNodeHash(left);
|
|
151
|
-
updateNodeHash(node);
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
if (right && rDist <= lDist) {
|
|
155
|
-
updateHash(right, k, hash);
|
|
156
|
-
updateNodeHash(right);
|
|
157
|
-
updateNodeHash(node);
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
function diffAB(diffA, diffB, nodeA, nodeB) {
|
|
163
|
-
if (nodeA &&
|
|
164
|
-
nodeB &&
|
|
165
|
-
nodeA.key === nodeB.key &&
|
|
166
|
-
hashEq(nodeA.hash, nodeB.hash)) {
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
// No hash match
|
|
170
|
-
const leftA = nodeA && nodeA.left;
|
|
171
|
-
const leftB = nodeB && nodeB.left;
|
|
172
|
-
const rightA = nodeA && nodeA.right;
|
|
173
|
-
const rightB = nodeB && nodeB.right;
|
|
174
|
-
// Check if this is a leaf that is missing from the right tree
|
|
175
|
-
if (nodeA && !leftA && !rightA) {
|
|
176
|
-
const bHash = diffB.get(nodeA.key);
|
|
177
|
-
if (bHash && hashEq(bHash, nodeA.hash)) {
|
|
178
|
-
// The same leaf appears to exist in both trees
|
|
179
|
-
diffB.delete(nodeA.key);
|
|
180
|
-
}
|
|
181
|
-
else {
|
|
182
|
-
// The leaf doesn't exist or differs from the right tree
|
|
183
|
-
diffA.set(nodeA.key, nodeA.hash);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
// Check if this is a leaf that is missing from the left tree
|
|
187
|
-
if (nodeB && !leftB && !rightB) {
|
|
188
|
-
const aHash = diffA.get(nodeB.key);
|
|
189
|
-
if (aHash && hashEq(aHash, nodeB.hash)) {
|
|
190
|
-
diffA.delete(nodeB.key);
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
diffB.set(nodeB.key, nodeB.hash);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
if (leftA || leftB) {
|
|
197
|
-
// Recurse to the left branch
|
|
198
|
-
diffAB(diffA, diffB, leftA, leftB);
|
|
199
|
-
}
|
|
200
|
-
if (rightA || rightB) {
|
|
201
|
-
// Recurse to the right branch
|
|
202
|
-
diffAB(diffA, diffB, rightA, rightB);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
function diff(tree) {
|
|
206
|
-
const leftMap = new Map();
|
|
207
|
-
const rightMap = new Map();
|
|
208
|
-
const nodeA = root;
|
|
209
|
-
const nodeB = tree.getRoot();
|
|
210
|
-
diffAB(leftMap, rightMap, nodeA, nodeB);
|
|
211
|
-
return {
|
|
212
|
-
left: [...leftMap],
|
|
213
|
-
right: [...rightMap],
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
function _visitLeafNodes(node, cb) {
|
|
217
|
-
if (!node)
|
|
218
|
-
return;
|
|
219
|
-
if (!node.left && !node.right)
|
|
220
|
-
cb(node);
|
|
221
|
-
else {
|
|
222
|
-
if (node.left)
|
|
223
|
-
_visitLeafNodes(node.left, cb);
|
|
224
|
-
if (node.right)
|
|
225
|
-
_visitLeafNodes(node.right, cb);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
function search(node, k) {
|
|
229
|
-
if (!node || (k === node.key && !node.left && !node.right))
|
|
230
|
-
return node;
|
|
231
|
-
const { left, right } = node;
|
|
232
|
-
if (left && left.key === k)
|
|
233
|
-
return search(left, k);
|
|
234
|
-
if (right && right.key === k)
|
|
235
|
-
return search(right, k);
|
|
236
|
-
const lDist = distance(k, (left && left.key) || TreeKeyNil);
|
|
237
|
-
const rDist = distance(k, (right && right.key) || TreeKeyNil);
|
|
238
|
-
if (left && lDist <= rDist)
|
|
239
|
-
return search(left, k);
|
|
240
|
-
if (right && rDist <= lDist)
|
|
241
|
-
return search(right, k);
|
|
242
|
-
return null;
|
|
243
|
-
}
|
|
244
|
-
return {
|
|
245
|
-
emptyHash,
|
|
246
|
-
getRoot: () => root,
|
|
247
|
-
insert: (k, h, data = null) => {
|
|
248
|
-
if (!(h instanceof Uint8Array)) {
|
|
249
|
-
throw new TypeError('`h` must be a Uint8Array');
|
|
250
|
-
}
|
|
251
|
-
const newLeaf = createLeaf(k, h, data);
|
|
252
|
-
root = root ? insert(root, newLeaf) : newLeaf;
|
|
253
|
-
},
|
|
254
|
-
update: (k, h) => {
|
|
255
|
-
if (root) {
|
|
256
|
-
updateHash(root, k, h);
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
|
-
delete: (k) => {
|
|
260
|
-
if (root) {
|
|
261
|
-
root = deleteNode(root, k);
|
|
262
|
-
}
|
|
263
|
-
},
|
|
264
|
-
diff,
|
|
265
|
-
membershipProof: (k) => membershipProof(root, k),
|
|
266
|
-
visitLeafNodes: (cb) => _visitLeafNodes(root, cb),
|
|
267
|
-
search: (k) => search(root, k),
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
//# sourceMappingURL=tree.js.map
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Proof } from './memebership-proof.js';
|
|
2
|
-
export type TreeKey = number;
|
|
3
|
-
export declare const TreeKeyNil = 0;
|
|
4
|
-
export type Hash = Uint8Array;
|
|
5
|
-
export interface TreeNode<T> {
|
|
6
|
-
hash: Hash;
|
|
7
|
-
key: TreeKey | null;
|
|
8
|
-
data?: T | null;
|
|
9
|
-
left: TreeNode<T> | null;
|
|
10
|
-
right: TreeNode<T> | null;
|
|
11
|
-
}
|
|
12
|
-
export type KeyHashPair = [TreeKey, Hash];
|
|
13
|
-
export interface TreeDiff {
|
|
14
|
-
left: KeyHashPair[];
|
|
15
|
-
right: KeyHashPair[];
|
|
16
|
-
}
|
|
17
|
-
export interface Csmt<T> {
|
|
18
|
-
emptyHash: Uint8Array;
|
|
19
|
-
/**
|
|
20
|
-
* Get the root node.
|
|
21
|
-
*/
|
|
22
|
-
getRoot: () => TreeNode<T> | null;
|
|
23
|
-
/**
|
|
24
|
-
* Insert a new key-hash pair.
|
|
25
|
-
*/
|
|
26
|
-
insert: (k: TreeKey, h: Hash, data?: any) => void;
|
|
27
|
-
/**
|
|
28
|
-
* Delete a key-hash pair from the tree.
|
|
29
|
-
*/
|
|
30
|
-
delete: (k: TreeKey) => void;
|
|
31
|
-
/**
|
|
32
|
-
* Update node hash.
|
|
33
|
-
*/
|
|
34
|
-
update: (k: TreeKey, h: Hash) => void;
|
|
35
|
-
/**
|
|
36
|
-
* Compute the diff between this and a given tree.
|
|
37
|
-
*/
|
|
38
|
-
diff: (tree: Csmt<T>) => TreeDiff;
|
|
39
|
-
/**
|
|
40
|
-
* Provide a proof of membership if a key exist in the three;
|
|
41
|
-
* Otherwise a proof of non-membership is returned.
|
|
42
|
-
*/
|
|
43
|
-
membershipProof: (k: TreeKey) => Proof;
|
|
44
|
-
visitLeafNodes: (cb: (leaf: TreeNode<T>) => void) => void;
|
|
45
|
-
search: (k: TreeKey) => TreeNode<T>;
|
|
46
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { isMainThread, parentPort, workerData } from 'node:worker_threads';
|
|
2
|
-
import native from '../native.js';
|
|
3
|
-
if (isMainThread) {
|
|
4
|
-
console.warn('running query worker.ts in mainthread - incorrect');
|
|
5
|
-
}
|
|
6
|
-
else if (workerData?.isDbWorker) {
|
|
7
|
-
let { address, channel } = workerData;
|
|
8
|
-
let dbCtx = native.externalFromInt(address);
|
|
9
|
-
native.workerCtxInit();
|
|
10
|
-
const handleMsg = (msg) => {
|
|
11
|
-
try {
|
|
12
|
-
if (typeof msg === 'bigint') {
|
|
13
|
-
// it's a ctx address
|
|
14
|
-
address = msg;
|
|
15
|
-
dbCtx = native.externalFromInt(address);
|
|
16
|
-
channel.postMessage(null);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
const arrayBuf = native.getQueryBuf(msg, dbCtx);
|
|
20
|
-
channel.postMessage(arrayBuf, [arrayBuf]);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
catch (e) {
|
|
24
|
-
channel.postMessage(e);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
channel.on('message', handleMsg);
|
|
28
|
-
parentPort.postMessage('READY');
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
console.info('incorrect worker db query');
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=worker.js.map
|
|
File without changes
|