@omegup/msync 0.1.26 → 0.1.27
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.esm.js +10 -1
- package/index.js +10 -1
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -1718,7 +1718,16 @@ const loop = async (db) => {
|
|
|
1718
1718
|
}
|
|
1719
1719
|
continue;
|
|
1720
1720
|
}
|
|
1721
|
-
const
|
|
1721
|
+
const groupBy = (arr, fn) => {
|
|
1722
|
+
return arr.reduce((acc, x) => {
|
|
1723
|
+
const k = fn(x);
|
|
1724
|
+
if (!acc[k])
|
|
1725
|
+
acc[k] = [];
|
|
1726
|
+
acc[k].push(x);
|
|
1727
|
+
return acc;
|
|
1728
|
+
}, {});
|
|
1729
|
+
};
|
|
1730
|
+
const groups = groupBy(events.filter(e => e.changeTouched), ev => ev.doc.ns);
|
|
1722
1731
|
for (const [ns, evs] of Object.entries(groups)) {
|
|
1723
1732
|
if (!evs)
|
|
1724
1733
|
continue;
|
package/index.js
CHANGED
|
@@ -1720,7 +1720,16 @@ const loop = async (db) => {
|
|
|
1720
1720
|
}
|
|
1721
1721
|
continue;
|
|
1722
1722
|
}
|
|
1723
|
-
const
|
|
1723
|
+
const groupBy = (arr, fn) => {
|
|
1724
|
+
return arr.reduce((acc, x) => {
|
|
1725
|
+
const k = fn(x);
|
|
1726
|
+
if (!acc[k])
|
|
1727
|
+
acc[k] = [];
|
|
1728
|
+
acc[k].push(x);
|
|
1729
|
+
return acc;
|
|
1730
|
+
}, {});
|
|
1731
|
+
};
|
|
1732
|
+
const groups = groupBy(events.filter(e => e.changeTouched), ev => ev.doc.ns);
|
|
1724
1733
|
for (const [ns, evs] of Object.entries(groups)) {
|
|
1725
1734
|
if (!evs)
|
|
1726
1735
|
continue;
|