@graffy/common 0.16.0-alpha.9 → 0.16.1
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/index.cjs +66 -56
- package/index.mjs +66 -56
- package/package.json +3 -3
- package/types/ops/finalize.d.ts +8 -1
- package/types/ops/setVersion.d.ts +1 -1
package/index.cjs
CHANGED
|
@@ -14,13 +14,19 @@ function encode$6(string) {
|
|
|
14
14
|
function decode$6(u8Arr) {
|
|
15
15
|
return textDecoder.decode(u8Arr);
|
|
16
16
|
}
|
|
17
|
+
function TwosComplement(view) {
|
|
18
|
+
let lo = -view.getUint32(4) >>> 0;
|
|
19
|
+
const carry = lo ? 0 : -1;
|
|
20
|
+
let hi = ~view.getUint32(0) + carry >>> 0;
|
|
21
|
+
view.setUint32(0, hi);
|
|
22
|
+
view.setUint32(4, lo);
|
|
23
|
+
}
|
|
17
24
|
function encode$5(number) {
|
|
18
25
|
const buffer = new ArrayBuffer(8);
|
|
19
26
|
const view = new DataView(buffer);
|
|
20
27
|
view.setFloat64(0, number);
|
|
21
28
|
if (number < 0) {
|
|
22
|
-
|
|
23
|
-
view.setUint32(4, ~view.getUint32(4) >>> 0);
|
|
29
|
+
TwosComplement(view);
|
|
24
30
|
} else {
|
|
25
31
|
view.setUint8(0, view.getUint8(0) | 128);
|
|
26
32
|
}
|
|
@@ -35,8 +41,7 @@ function decode$5(u8Arr) {
|
|
|
35
41
|
if (high & 128) {
|
|
36
42
|
view.setUint8(0, high & 127);
|
|
37
43
|
} else {
|
|
38
|
-
|
|
39
|
-
view.setUint32(4, ~view.getUint32(4) >>> 0);
|
|
44
|
+
TwosComplement(view);
|
|
40
45
|
}
|
|
41
46
|
return view.getFloat64(0);
|
|
42
47
|
}
|
|
@@ -118,6 +123,9 @@ const stringifyDescriptor = {
|
|
|
118
123
|
}
|
|
119
124
|
};
|
|
120
125
|
function addStringify(buffer) {
|
|
126
|
+
if ("toJSON" in buffer || "toString" in buffer || Symbol.for("nodejs.util.inspect.custom") in buffer) {
|
|
127
|
+
return buffer;
|
|
128
|
+
}
|
|
121
129
|
Object.defineProperties(buffer, {
|
|
122
130
|
toJSON: stringifyDescriptor,
|
|
123
131
|
toString: stringifyDescriptor,
|
|
@@ -282,10 +290,12 @@ function keyStep(key) {
|
|
|
282
290
|
switch (key[l]) {
|
|
283
291
|
case 0:
|
|
284
292
|
newKey = key.slice(0, l);
|
|
293
|
+
addStringify(newKey);
|
|
285
294
|
step = 1;
|
|
286
295
|
break;
|
|
287
296
|
case 255:
|
|
288
297
|
newKey = key.slice(0, l);
|
|
298
|
+
addStringify(newKey);
|
|
289
299
|
newKey[l - 1]++;
|
|
290
300
|
step = -1;
|
|
291
301
|
break;
|
|
@@ -293,7 +303,7 @@ function keyStep(key) {
|
|
|
293
303
|
newKey = key;
|
|
294
304
|
step = 0;
|
|
295
305
|
}
|
|
296
|
-
return { key:
|
|
306
|
+
return { key: newKey, step };
|
|
297
307
|
}
|
|
298
308
|
function keyBefore(key) {
|
|
299
309
|
if (isMinKey(key) || isMaxKey(key))
|
|
@@ -1011,11 +1021,12 @@ function getNewerChange(node, base) {
|
|
|
1011
1021
|
return node.version >= base.version ? node : null;
|
|
1012
1022
|
}
|
|
1013
1023
|
}
|
|
1014
|
-
function setVersion(graph, version) {
|
|
1024
|
+
function setVersion(graph, version, onlyIfZero = false) {
|
|
1015
1025
|
for (const node of graph) {
|
|
1016
|
-
node.version
|
|
1026
|
+
if (!onlyIfZero || !node.version)
|
|
1027
|
+
node.version = version;
|
|
1017
1028
|
if (node.children)
|
|
1018
|
-
setVersion(node.children, version);
|
|
1029
|
+
setVersion(node.children, version, onlyIfZero);
|
|
1019
1030
|
}
|
|
1020
1031
|
return graph;
|
|
1021
1032
|
}
|
|
@@ -1037,13 +1048,13 @@ function getKnown(graph, version = 0) {
|
|
|
1037
1048
|
}
|
|
1038
1049
|
return query;
|
|
1039
1050
|
}
|
|
1040
|
-
function finalize(graph, query, version = Date.now()
|
|
1051
|
+
function finalize(graph, query, version = Date.now()) {
|
|
1041
1052
|
let result = [{ key: MIN_KEY, end: MAX_KEY, version: 0 }];
|
|
1042
1053
|
merge(result, graph);
|
|
1043
1054
|
if (query)
|
|
1044
1055
|
result = slice(result, query).known || [];
|
|
1045
|
-
if (!
|
|
1046
|
-
result = setVersion(result, version);
|
|
1056
|
+
if (!version !== false)
|
|
1057
|
+
result = setVersion(result, version, true);
|
|
1047
1058
|
return result;
|
|
1048
1059
|
}
|
|
1049
1060
|
const PRE_CHI_PUT = Symbol("PREFIX_CHILDREN_$PUT");
|
|
@@ -1484,15 +1495,8 @@ function encode(value, { version, isGraph } = {}) {
|
|
|
1484
1495
|
const links = [];
|
|
1485
1496
|
function pushLink($ref, $ver, props2, $val, $chi) {
|
|
1486
1497
|
const [range, _] = splitRef($ref);
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
void 0,
|
|
1490
|
-
$ver
|
|
1491
|
-
).children : isDef($chi) ? makeNode2(
|
|
1492
|
-
range ? [{ $key: range, $chi }] : $chi,
|
|
1493
|
-
void 0,
|
|
1494
|
-
$ver
|
|
1495
|
-
).children : isDef($val) ? $val : isGraph ? void 0 : 1;
|
|
1498
|
+
const node = !isEmpty(props2) ? makeNode2(range ? [{ $key: range, ...props2 }] : props2, void 0, $ver) : isDef($chi) ? makeNode2(range ? [{ $key: range, $chi }] : $chi, void 0, $ver) : null;
|
|
1499
|
+
const children = node ? node.children : isDef($val) ? $val : isGraph ? void 0 : 1;
|
|
1496
1500
|
if (children) {
|
|
1497
1501
|
links.push(wrap(children, encode$2($ref), $ver, !!range)[0]);
|
|
1498
1502
|
}
|
|
@@ -1502,41 +1506,50 @@ function encode(value, { version, isGraph } = {}) {
|
|
|
1502
1506
|
var _a2;
|
|
1503
1507
|
if (!isDef(object))
|
|
1504
1508
|
return;
|
|
1509
|
+
const { $key, $ver, $ref, $val, $chi, $put, ...props2 } = object || {};
|
|
1510
|
+
if (typeof object === "object" && object && !Array.isArray(object)) {
|
|
1511
|
+
object = {
|
|
1512
|
+
...Object.fromEntries(
|
|
1513
|
+
Object.entries({
|
|
1514
|
+
$key,
|
|
1515
|
+
$ver,
|
|
1516
|
+
$ref,
|
|
1517
|
+
$val,
|
|
1518
|
+
$chi,
|
|
1519
|
+
$put
|
|
1520
|
+
}).filter(([_, val]) => isDef(val))
|
|
1521
|
+
),
|
|
1522
|
+
...props2
|
|
1523
|
+
};
|
|
1524
|
+
}
|
|
1505
1525
|
if (typeof object === "object" && object && isEmpty(object))
|
|
1506
1526
|
return;
|
|
1507
|
-
const { $key, $ver, $ref, $val, $chi, $put, ...props2 } = object || {};
|
|
1508
1527
|
if (isDef($ver))
|
|
1509
1528
|
ver = $ver;
|
|
1510
1529
|
if (isPlainObject($key)) {
|
|
1511
1530
|
const [page, filter] = splitArgs($key);
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
ver
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
node2.
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
ver
|
|
1535
|
-
);
|
|
1536
|
-
if (!filter)
|
|
1537
|
-
node2.key = MIN_KEY;
|
|
1538
|
-
node2.prefix = true;
|
|
1539
|
-
return node2;
|
|
1531
|
+
if (page) {
|
|
1532
|
+
const foundPuts = parentPuts.filter(([_, putFilter]) => isEqual__default.default(filter, putFilter)).map(([range]) => range);
|
|
1533
|
+
if (isGraph && !isDef(page.$cursor) && ($ref || $val || $chi || $put || !isEmpty(props2))) {
|
|
1534
|
+
object.$key = filter || {};
|
|
1535
|
+
object.$put = foundPuts;
|
|
1536
|
+
const node2 = makeNode2(object, key, ver);
|
|
1537
|
+
if (!filter)
|
|
1538
|
+
node2.key = MIN_KEY;
|
|
1539
|
+
node2.prefix = true;
|
|
1540
|
+
return node2;
|
|
1541
|
+
}
|
|
1542
|
+
if ((!isDef(key) || Number.isInteger(key)) && (filter || isDef(page.$cursor))) {
|
|
1543
|
+
object.$key = isDef(page.$cursor) ? page.$cursor : page;
|
|
1544
|
+
const wrapper = { $key: filter || {}, $chi: [object] };
|
|
1545
|
+
if (isGraph)
|
|
1546
|
+
wrapper.$put = foundPuts;
|
|
1547
|
+
const node2 = makeNode2(wrapper, key, ver);
|
|
1548
|
+
if (!filter)
|
|
1549
|
+
node2.key = MIN_KEY;
|
|
1550
|
+
node2.prefix = true;
|
|
1551
|
+
return node2;
|
|
1552
|
+
}
|
|
1540
1553
|
}
|
|
1541
1554
|
}
|
|
1542
1555
|
let putQuery = [], prefixPuts = [];
|
|
@@ -1609,12 +1622,7 @@ function encode(value, { version, isGraph } = {}) {
|
|
|
1609
1622
|
}
|
|
1610
1623
|
}
|
|
1611
1624
|
if (isGraph && (putQuery === null || putQuery.length)) {
|
|
1612
|
-
node.children = finalize(
|
|
1613
|
-
node.children || [],
|
|
1614
|
-
putQuery,
|
|
1615
|
-
node.version,
|
|
1616
|
-
true
|
|
1617
|
-
);
|
|
1625
|
+
node.children = finalize(node.children || [], putQuery, false);
|
|
1618
1626
|
}
|
|
1619
1627
|
if (((_a2 = node.children) == null ? void 0 : _a2.length) || isDef(node.end) || isDef(node.value) || isDef(node.path)) {
|
|
1620
1628
|
return node;
|
|
@@ -1629,7 +1637,9 @@ function encode(value, { version, isGraph } = {}) {
|
|
|
1629
1637
|
return result;
|
|
1630
1638
|
}
|
|
1631
1639
|
function encodeGraph(obj, version = Date.now()) {
|
|
1632
|
-
|
|
1640
|
+
const encoded = encode(obj, { version, isGraph: true });
|
|
1641
|
+
const versioned = setVersion(encoded, version, true);
|
|
1642
|
+
return versioned;
|
|
1633
1643
|
}
|
|
1634
1644
|
function encodeQuery(obj, version = 0) {
|
|
1635
1645
|
return encode(obj, { version, isGraph: false });
|
package/index.mjs
CHANGED
|
@@ -9,13 +9,19 @@ function encode$6(string) {
|
|
|
9
9
|
function decode$6(u8Arr) {
|
|
10
10
|
return textDecoder.decode(u8Arr);
|
|
11
11
|
}
|
|
12
|
+
function TwosComplement(view) {
|
|
13
|
+
let lo = -view.getUint32(4) >>> 0;
|
|
14
|
+
const carry = lo ? 0 : -1;
|
|
15
|
+
let hi = ~view.getUint32(0) + carry >>> 0;
|
|
16
|
+
view.setUint32(0, hi);
|
|
17
|
+
view.setUint32(4, lo);
|
|
18
|
+
}
|
|
12
19
|
function encode$5(number) {
|
|
13
20
|
const buffer = new ArrayBuffer(8);
|
|
14
21
|
const view = new DataView(buffer);
|
|
15
22
|
view.setFloat64(0, number);
|
|
16
23
|
if (number < 0) {
|
|
17
|
-
|
|
18
|
-
view.setUint32(4, ~view.getUint32(4) >>> 0);
|
|
24
|
+
TwosComplement(view);
|
|
19
25
|
} else {
|
|
20
26
|
view.setUint8(0, view.getUint8(0) | 128);
|
|
21
27
|
}
|
|
@@ -30,8 +36,7 @@ function decode$5(u8Arr) {
|
|
|
30
36
|
if (high & 128) {
|
|
31
37
|
view.setUint8(0, high & 127);
|
|
32
38
|
} else {
|
|
33
|
-
|
|
34
|
-
view.setUint32(4, ~view.getUint32(4) >>> 0);
|
|
39
|
+
TwosComplement(view);
|
|
35
40
|
}
|
|
36
41
|
return view.getFloat64(0);
|
|
37
42
|
}
|
|
@@ -113,6 +118,9 @@ const stringifyDescriptor = {
|
|
|
113
118
|
}
|
|
114
119
|
};
|
|
115
120
|
function addStringify(buffer) {
|
|
121
|
+
if ("toJSON" in buffer || "toString" in buffer || Symbol.for("nodejs.util.inspect.custom") in buffer) {
|
|
122
|
+
return buffer;
|
|
123
|
+
}
|
|
116
124
|
Object.defineProperties(buffer, {
|
|
117
125
|
toJSON: stringifyDescriptor,
|
|
118
126
|
toString: stringifyDescriptor,
|
|
@@ -277,10 +285,12 @@ function keyStep(key) {
|
|
|
277
285
|
switch (key[l]) {
|
|
278
286
|
case 0:
|
|
279
287
|
newKey = key.slice(0, l);
|
|
288
|
+
addStringify(newKey);
|
|
280
289
|
step = 1;
|
|
281
290
|
break;
|
|
282
291
|
case 255:
|
|
283
292
|
newKey = key.slice(0, l);
|
|
293
|
+
addStringify(newKey);
|
|
284
294
|
newKey[l - 1]++;
|
|
285
295
|
step = -1;
|
|
286
296
|
break;
|
|
@@ -288,7 +298,7 @@ function keyStep(key) {
|
|
|
288
298
|
newKey = key;
|
|
289
299
|
step = 0;
|
|
290
300
|
}
|
|
291
|
-
return { key:
|
|
301
|
+
return { key: newKey, step };
|
|
292
302
|
}
|
|
293
303
|
function keyBefore(key) {
|
|
294
304
|
if (isMinKey(key) || isMaxKey(key))
|
|
@@ -1006,11 +1016,12 @@ function getNewerChange(node, base) {
|
|
|
1006
1016
|
return node.version >= base.version ? node : null;
|
|
1007
1017
|
}
|
|
1008
1018
|
}
|
|
1009
|
-
function setVersion(graph, version) {
|
|
1019
|
+
function setVersion(graph, version, onlyIfZero = false) {
|
|
1010
1020
|
for (const node of graph) {
|
|
1011
|
-
node.version
|
|
1021
|
+
if (!onlyIfZero || !node.version)
|
|
1022
|
+
node.version = version;
|
|
1012
1023
|
if (node.children)
|
|
1013
|
-
setVersion(node.children, version);
|
|
1024
|
+
setVersion(node.children, version, onlyIfZero);
|
|
1014
1025
|
}
|
|
1015
1026
|
return graph;
|
|
1016
1027
|
}
|
|
@@ -1032,13 +1043,13 @@ function getKnown(graph, version = 0) {
|
|
|
1032
1043
|
}
|
|
1033
1044
|
return query;
|
|
1034
1045
|
}
|
|
1035
|
-
function finalize(graph, query, version = Date.now()
|
|
1046
|
+
function finalize(graph, query, version = Date.now()) {
|
|
1036
1047
|
let result = [{ key: MIN_KEY, end: MAX_KEY, version: 0 }];
|
|
1037
1048
|
merge(result, graph);
|
|
1038
1049
|
if (query)
|
|
1039
1050
|
result = slice(result, query).known || [];
|
|
1040
|
-
if (!
|
|
1041
|
-
result = setVersion(result, version);
|
|
1051
|
+
if (!version !== false)
|
|
1052
|
+
result = setVersion(result, version, true);
|
|
1042
1053
|
return result;
|
|
1043
1054
|
}
|
|
1044
1055
|
const PRE_CHI_PUT = Symbol("PREFIX_CHILDREN_$PUT");
|
|
@@ -1479,15 +1490,8 @@ function encode(value, { version, isGraph } = {}) {
|
|
|
1479
1490
|
const links = [];
|
|
1480
1491
|
function pushLink($ref, $ver, props2, $val, $chi) {
|
|
1481
1492
|
const [range, _] = splitRef($ref);
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
void 0,
|
|
1485
|
-
$ver
|
|
1486
|
-
).children : isDef($chi) ? makeNode2(
|
|
1487
|
-
range ? [{ $key: range, $chi }] : $chi,
|
|
1488
|
-
void 0,
|
|
1489
|
-
$ver
|
|
1490
|
-
).children : isDef($val) ? $val : isGraph ? void 0 : 1;
|
|
1493
|
+
const node = !isEmpty(props2) ? makeNode2(range ? [{ $key: range, ...props2 }] : props2, void 0, $ver) : isDef($chi) ? makeNode2(range ? [{ $key: range, $chi }] : $chi, void 0, $ver) : null;
|
|
1494
|
+
const children = node ? node.children : isDef($val) ? $val : isGraph ? void 0 : 1;
|
|
1491
1495
|
if (children) {
|
|
1492
1496
|
links.push(wrap(children, encode$2($ref), $ver, !!range)[0]);
|
|
1493
1497
|
}
|
|
@@ -1497,41 +1501,50 @@ function encode(value, { version, isGraph } = {}) {
|
|
|
1497
1501
|
var _a2;
|
|
1498
1502
|
if (!isDef(object))
|
|
1499
1503
|
return;
|
|
1504
|
+
const { $key, $ver, $ref, $val, $chi, $put, ...props2 } = object || {};
|
|
1505
|
+
if (typeof object === "object" && object && !Array.isArray(object)) {
|
|
1506
|
+
object = {
|
|
1507
|
+
...Object.fromEntries(
|
|
1508
|
+
Object.entries({
|
|
1509
|
+
$key,
|
|
1510
|
+
$ver,
|
|
1511
|
+
$ref,
|
|
1512
|
+
$val,
|
|
1513
|
+
$chi,
|
|
1514
|
+
$put
|
|
1515
|
+
}).filter(([_, val]) => isDef(val))
|
|
1516
|
+
),
|
|
1517
|
+
...props2
|
|
1518
|
+
};
|
|
1519
|
+
}
|
|
1500
1520
|
if (typeof object === "object" && object && isEmpty(object))
|
|
1501
1521
|
return;
|
|
1502
|
-
const { $key, $ver, $ref, $val, $chi, $put, ...props2 } = object || {};
|
|
1503
1522
|
if (isDef($ver))
|
|
1504
1523
|
ver = $ver;
|
|
1505
1524
|
if (isPlainObject($key)) {
|
|
1506
1525
|
const [page, filter] = splitArgs($key);
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
ver
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
node2.
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
ver
|
|
1530
|
-
);
|
|
1531
|
-
if (!filter)
|
|
1532
|
-
node2.key = MIN_KEY;
|
|
1533
|
-
node2.prefix = true;
|
|
1534
|
-
return node2;
|
|
1526
|
+
if (page) {
|
|
1527
|
+
const foundPuts = parentPuts.filter(([_, putFilter]) => isEqual(filter, putFilter)).map(([range]) => range);
|
|
1528
|
+
if (isGraph && !isDef(page.$cursor) && ($ref || $val || $chi || $put || !isEmpty(props2))) {
|
|
1529
|
+
object.$key = filter || {};
|
|
1530
|
+
object.$put = foundPuts;
|
|
1531
|
+
const node2 = makeNode2(object, key, ver);
|
|
1532
|
+
if (!filter)
|
|
1533
|
+
node2.key = MIN_KEY;
|
|
1534
|
+
node2.prefix = true;
|
|
1535
|
+
return node2;
|
|
1536
|
+
}
|
|
1537
|
+
if ((!isDef(key) || Number.isInteger(key)) && (filter || isDef(page.$cursor))) {
|
|
1538
|
+
object.$key = isDef(page.$cursor) ? page.$cursor : page;
|
|
1539
|
+
const wrapper = { $key: filter || {}, $chi: [object] };
|
|
1540
|
+
if (isGraph)
|
|
1541
|
+
wrapper.$put = foundPuts;
|
|
1542
|
+
const node2 = makeNode2(wrapper, key, ver);
|
|
1543
|
+
if (!filter)
|
|
1544
|
+
node2.key = MIN_KEY;
|
|
1545
|
+
node2.prefix = true;
|
|
1546
|
+
return node2;
|
|
1547
|
+
}
|
|
1535
1548
|
}
|
|
1536
1549
|
}
|
|
1537
1550
|
let putQuery = [], prefixPuts = [];
|
|
@@ -1604,12 +1617,7 @@ function encode(value, { version, isGraph } = {}) {
|
|
|
1604
1617
|
}
|
|
1605
1618
|
}
|
|
1606
1619
|
if (isGraph && (putQuery === null || putQuery.length)) {
|
|
1607
|
-
node.children = finalize(
|
|
1608
|
-
node.children || [],
|
|
1609
|
-
putQuery,
|
|
1610
|
-
node.version,
|
|
1611
|
-
true
|
|
1612
|
-
);
|
|
1620
|
+
node.children = finalize(node.children || [], putQuery, false);
|
|
1613
1621
|
}
|
|
1614
1622
|
if (((_a2 = node.children) == null ? void 0 : _a2.length) || isDef(node.end) || isDef(node.value) || isDef(node.path)) {
|
|
1615
1623
|
return node;
|
|
@@ -1624,7 +1632,9 @@ function encode(value, { version, isGraph } = {}) {
|
|
|
1624
1632
|
return result;
|
|
1625
1633
|
}
|
|
1626
1634
|
function encodeGraph(obj, version = Date.now()) {
|
|
1627
|
-
|
|
1635
|
+
const encoded = encode(obj, { version, isGraph: true });
|
|
1636
|
+
const versioned = setVersion(encoded, version, true);
|
|
1637
|
+
return versioned;
|
|
1628
1638
|
}
|
|
1629
1639
|
function encodeQuery(obj, version = 0) {
|
|
1630
1640
|
return encode(obj, { version, isGraph: false });
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graffy/common",
|
|
3
3
|
"description": "Common libraries that used by various Graffy modules.",
|
|
4
4
|
"author": "aravind (https://github.com/aravindet)",
|
|
5
|
-
"version": "0.16.
|
|
5
|
+
"version": "0.16.1",
|
|
6
6
|
"main": "./index.cjs",
|
|
7
7
|
"exports": {
|
|
8
8
|
"import": "./index.mjs",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"license": "Apache-2.0",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"lodash": "^4.17.19",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
20
|
+
"merge-async-iterators": "^0.2.1",
|
|
21
|
+
"@graffy/stream": "0.16.1"
|
|
22
22
|
}
|
|
23
23
|
}
|
package/types/ops/finalize.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {any} graph
|
|
4
|
+
* @param {any} query
|
|
5
|
+
* @param {number | false} version
|
|
6
|
+
* @returns any
|
|
7
|
+
*/
|
|
8
|
+
export default function finalize(graph: any, query: any, version?: number | false): {
|
|
2
9
|
key: Uint8Array;
|
|
3
10
|
end: Uint8Array;
|
|
4
11
|
version: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function setVersion(graph: any, version: any): any;
|
|
1
|
+
export default function setVersion(graph: any, version: any, onlyIfZero?: boolean): any;
|