@omegup/msync 0.1.64 → 0.1.66

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 CHANGED
@@ -73,7 +73,7 @@ const $let = (vars, inExpr) => asExpr({ raw: (f) => asExprRaw({ $let: {
73
73
  } }) });
74
74
  const nil = val(null);
75
75
  const $getField = (expr, field) => asExpr({ raw: (f) => asExprRaw({ $getField: {
76
- field,
76
+ field: typeof field === "string" ? field : field.raw(f).get(),
77
77
  input: expr.raw(f).get()
78
78
  } }) });
79
79
  const func = (f, ...args) => asExpr({ raw: (field) => asExprRaw({ $function: {
@@ -658,7 +658,7 @@ const $mergeX = (out, keys, f, map, ext, update) => {
658
658
  _id: ["_id", f.of("_id").expr()],
659
659
  touchedAt: ["touchedAt", current]
660
660
  })));
661
- const sss = setDeleted ? link().with($set_(set()({ deletedAt: ["deletedAt", to(current)] }))).with($merge_({
661
+ const sss = setDeleted ? link().with($set_(set()({ deletedAt: ["deletedAt", to(now())] }))).with($merge_({
662
662
  into: out.coll,
663
663
  on: root().of("_id"),
664
664
  whenNotMatched: "insert",
@@ -742,7 +742,7 @@ const subMerge = (args, out, gid, extra, idPrefix, first) => {
742
742
  })).stages;
743
743
  }
744
744
  if (out.whenNotMatched === "discard") {
745
- const discardMarker = $set_(set()({ deletedAt: ["deletedAt", to(current)] }));
745
+ const discardMarker = $set_(set()({ deletedAt: ["deletedAt", to(now())] }));
746
746
  return stages.with(discardMarker).with($merge_({
747
747
  into: out.into,
748
748
  whenNotMatched: "insert",
@@ -1429,7 +1429,7 @@ const $simpleInsert = (out, ext) => {
1429
1429
  const $insertPart = (out, ext) => {
1430
1430
  const extExpr = mapExact(ext, (v) => val(v));
1431
1431
  return $insertX(out, assertNotNull(root().of("after").expr()), (x) => ite(eq(root().of("after").expr())(nil), field(mergeExpr(extExpr, {
1432
- deletedAt: ["deletedAt", current],
1432
+ deletedAt: ["deletedAt", now()],
1433
1433
  _id: ["_id", assertNotNull(root().of("before").of("_id").expr())],
1434
1434
  touchedAt: ["touchedAt", current]
1435
1435
  })), x), ext, extExpr);