@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.
Files changed (3) hide show
  1. package/index.esm.js +10 -1
  2. package/index.js +10 -1
  3. 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 groups = Object.groupBy(events.filter(e => e.changeTouched), ev => ev.doc.ns);
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 groups = Object.groupBy(events.filter(e => e.changeTouched), ev => ev.doc.ns);
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;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "module": "index.esm.js",
4
4
  "typings": "index.d.ts",
5
5
  "name": "@omegup/msync",
6
- "version": "0.1.26",
6
+ "version": "0.1.27",
7
7
  "dependencies": {
8
8
  "dayjs": "^1.11.9",
9
9
  "dotenv": "^16.3.1",