@omegup/msync 0.0.24 → 0.0.26

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 +11 -11
  2. package/index.js +11 -11
  3. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -551,7 +551,9 @@ const $merge_ = ({ into, on, whenNotMatched, ...notMatched }) => asStages([
551
551
 
552
552
  const subMerge = (args, out, gid, extra, idPrefix, first) => {
553
553
  const doubleReplace = (x) => x;
554
- const mergeAggregates = $set_(set()(mapExact0(args, (v, k) => to(v.merge(root().of(k).expr(), ctx()('new').of(k).expr())))));
554
+ const mergeAggregates = $set_(set()(mapExact0(args, (v, k) => to(first
555
+ ? ctx()('new').of(k).expr()
556
+ : v.merge(root().of(k).expr(), ctx()('new').of(k).expr())))));
555
557
  const gidPath = root().of(gid).expr();
556
558
  const mapId = (k, v) => map1(k, v);
557
559
  const F1 = {
@@ -574,15 +576,13 @@ const subMerge = (args, out, gid, extra, idPrefix, first) => {
574
576
  .with($merge_({
575
577
  ...out,
576
578
  on: root().of(gid),
577
- ...(first
578
- ? { whenMatched: 'merge' }
579
- : {
580
- vars: { new: ['new', root().expr()] },
581
- stages: 'ctx',
582
- whenMatched: link()
583
- .with(mergeAggregates)
584
- .with(doubleReplace($set_(updater))).stages,
585
- }),
579
+ ...{
580
+ vars: { new: ['new', root().expr()] },
581
+ stages: 'ctx',
582
+ whenMatched: link()
583
+ .with(mergeAggregates)
584
+ .with(doubleReplace($set_(updater))).stages,
585
+ },
586
586
  })).stages);
587
587
  };
588
588
 
@@ -1264,7 +1264,7 @@ const executes$1 = (view, input, streamName) => {
1264
1264
  method: m,
1265
1265
  params: p,
1266
1266
  };
1267
- await actions[method](collection, params);
1267
+ await Promise.all([snapshotCollection.drop(), actions[method](collection, params)]);
1268
1268
  };
1269
1269
  if (exists && !same)
1270
1270
  await handleTeardown(exists);
package/index.js CHANGED
@@ -553,7 +553,9 @@ const $merge_ = ({ into, on, whenNotMatched, ...notMatched }) => asStages([
553
553
 
554
554
  const subMerge = (args, out, gid, extra, idPrefix, first) => {
555
555
  const doubleReplace = (x) => x;
556
- const mergeAggregates = $set_(set()(mapExact0(args, (v, k) => to(v.merge(root().of(k).expr(), ctx()('new').of(k).expr())))));
556
+ const mergeAggregates = $set_(set()(mapExact0(args, (v, k) => to(first
557
+ ? ctx()('new').of(k).expr()
558
+ : v.merge(root().of(k).expr(), ctx()('new').of(k).expr())))));
557
559
  const gidPath = root().of(gid).expr();
558
560
  const mapId = (k, v) => map1(k, v);
559
561
  const F1 = {
@@ -576,15 +578,13 @@ const subMerge = (args, out, gid, extra, idPrefix, first) => {
576
578
  .with($merge_({
577
579
  ...out,
578
580
  on: root().of(gid),
579
- ...(first
580
- ? { whenMatched: 'merge' }
581
- : {
582
- vars: { new: ['new', root().expr()] },
583
- stages: 'ctx',
584
- whenMatched: link()
585
- .with(mergeAggregates)
586
- .with(doubleReplace($set_(updater))).stages,
587
- }),
581
+ ...{
582
+ vars: { new: ['new', root().expr()] },
583
+ stages: 'ctx',
584
+ whenMatched: link()
585
+ .with(mergeAggregates)
586
+ .with(doubleReplace($set_(updater))).stages,
587
+ },
588
588
  })).stages);
589
589
  };
590
590
 
@@ -1266,7 +1266,7 @@ const executes$1 = (view, input, streamName) => {
1266
1266
  method: m,
1267
1267
  params: p,
1268
1268
  };
1269
- await actions[method](collection, params);
1269
+ await Promise.all([snapshotCollection.drop(), actions[method](collection, params)]);
1270
1270
  };
1271
1271
  if (exists && !same)
1272
1272
  await handleTeardown(exists);
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.0.24",
6
+ "version": "0.0.26",
7
7
  "dependencies": {
8
8
  "dayjs": "^1.11.9",
9
9
  "dotenv": "^16.3.1",