@omegup/msync 0.0.85 → 0.0.86

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.d.ts CHANGED
@@ -497,9 +497,9 @@ type ND = {
497
497
  };
498
498
  type SafeE<E> = Omit<E, `$${string}` | keyof ID>;
499
499
  type Merge<T extends doc, E> = Omit<SafeE<E>, keyof (ND & TS)> & ((T & ND & TS) | Del);
500
- declare const $insertX: <T extends doc, D extends O, EEE extends RORec<string, rawItem>>(out: RWCollection<Merge<T, EEE>>, expr: Expr<T, D>, map: (x: Expr<T & ND & TS & Omit<SafeE<EEE>, keyof (ND & TS)>, D>) => Expr<Merge<T, EEE>, D>, ext: Exact<Omit<SafeE<EEE>, keyof (ND & TS)>, IdHKT>) => StreamRunnerParam<D, "out">;
500
+ declare const $insertX: <T extends doc, D extends O, EEE extends RORec<string, rawItem>>(out: RWCollection<Merge<T, EEE>>, expr: Expr<T, D>, map: (x: Expr<T & ND & TS & Omit<SafeE<EEE>, keyof (ND & TS)>, D>) => Expr<Merge<T, EEE>, D>, ext: Exact<Omit<SafeE<EEE>, keyof (ND & TS)>, IdHKT>, extExpr: ExprsExact<Omit<SafeE<EEE>, keyof (ND & TS)>, unknown>) => StreamRunnerParam<D, "out">;
501
501
  declare const $simpleInsert: <T extends doc>(out: RWCollection<Merge<T, {}>>) => StreamRunnerParam<T, "out">;
502
- declare const $insertPart: <T extends doc, EEE extends RORec<string, rawItem>>(out: RWCollection<Merge<T, EEE>>, ext: ExprsExact<Omit<SafeE<EEE>, keyof (ND & TS)>, unknown>) => StreamRunnerParam<Delta<T>, "out">;
502
+ declare const $insertPart: <T extends doc, EEE extends RORec<string, rawItem>>(out: RWCollection<Merge<T, EEE>>, ext: Exact<Omit<SafeE<EEE>, keyof (ND & TS)>, IdHKT>) => StreamRunnerParam<Delta<T>, "out">;
503
503
  declare const $insert: <T extends doc>(out: RWCollection<Merge<T, {}>>) => StreamRunnerParam<Delta<T>, "out">;
504
504
 
505
505
  declare const $group_: <V extends O>() => <ID, T extends O, C = unknown>(id: Expr<ID, T, C>, args: Accumulators<T, V, C>) => RawStages<O, T, Rec<"_id", ID> & V, C, 1>;
package/index.esm.js CHANGED
@@ -1403,8 +1403,7 @@ const $simpleMerge = () => (out, keys) => $mergeX(out, keys, root(), id$1);
1403
1403
  const $merge = () => (out, keys) => $mergeId()(out, keys, assertNotNull$1(root().of('before').of('_id').expr()));
1404
1404
  const assertNotNull$1 = (expr) => expr;
1405
1405
 
1406
- const $insertX = (out, expr, map, ext) => {
1407
- const extExpr = mapExact(ext, (v) => val(v));
1406
+ const $insertX = (out, expr, map, ext, extExpr) => {
1408
1407
  const filter = mapExactToObject(ext, v => ({ $eq: v }));
1409
1408
  return {
1410
1409
  teardown: c => c({
@@ -1431,12 +1430,15 @@ const $insertX = (out, expr, map, ext) => {
1431
1430
  },
1432
1431
  };
1433
1432
  };
1434
- const $simpleInsert = (out) => $insertX(out, root().expr(), id$1, {});
1435
- const $insertPart = (out, ext) => $insertX(out, assertNotNull(root().of('after').expr()), x => ite(eq(root().of('after').expr())(nil), field(mergeExpr(translateOmit().forward(ext), {
1436
- deletedAt: ['deletedAt', current],
1437
- _id: ['_id', assertNotNull(root().of('before').of('_id').expr())],
1438
- touchedAt: ['touchedAt', current],
1439
- })), x), ext);
1433
+ const $simpleInsert = (out) => $insertX(out, root().expr(), id$1, {}, {});
1434
+ const $insertPart = (out, ext) => {
1435
+ const extExpr = mapExact(ext, (v) => val(v));
1436
+ return $insertX(out, assertNotNull(root().of('after').expr()), x => ite(eq(root().of('after').expr())(nil), field(mergeExpr(translateOmit().forward(extExpr), {
1437
+ deletedAt: ['deletedAt', current],
1438
+ _id: ['_id', assertNotNull(root().of('before').of('_id').expr())],
1439
+ touchedAt: ['touchedAt', current],
1440
+ })), x), ext, extExpr);
1441
+ };
1440
1442
  const $insert = (out) => $insertPart(out, {});
1441
1443
  const assertNotNull = (expr) => expr;
1442
1444
 
package/index.js CHANGED
@@ -1405,8 +1405,7 @@ const $simpleMerge = () => (out, keys) => $mergeX(out, keys, root(), id$1);
1405
1405
  const $merge = () => (out, keys) => $mergeId()(out, keys, assertNotNull$1(root().of('before').of('_id').expr()));
1406
1406
  const assertNotNull$1 = (expr) => expr;
1407
1407
 
1408
- const $insertX = (out, expr, map, ext) => {
1409
- const extExpr = mapExact(ext, (v) => val(v));
1408
+ const $insertX = (out, expr, map, ext, extExpr) => {
1410
1409
  const filter = mapExactToObject(ext, v => ({ $eq: v }));
1411
1410
  return {
1412
1411
  teardown: c => c({
@@ -1433,12 +1432,15 @@ const $insertX = (out, expr, map, ext) => {
1433
1432
  },
1434
1433
  };
1435
1434
  };
1436
- const $simpleInsert = (out) => $insertX(out, root().expr(), id$1, {});
1437
- const $insertPart = (out, ext) => $insertX(out, assertNotNull(root().of('after').expr()), x => ite(eq(root().of('after').expr())(nil), field(mergeExpr(translateOmit().forward(ext), {
1438
- deletedAt: ['deletedAt', current],
1439
- _id: ['_id', assertNotNull(root().of('before').of('_id').expr())],
1440
- touchedAt: ['touchedAt', current],
1441
- })), x), ext);
1435
+ const $simpleInsert = (out) => $insertX(out, root().expr(), id$1, {}, {});
1436
+ const $insertPart = (out, ext) => {
1437
+ const extExpr = mapExact(ext, (v) => val(v));
1438
+ return $insertX(out, assertNotNull(root().of('after').expr()), x => ite(eq(root().of('after').expr())(nil), field(mergeExpr(translateOmit().forward(extExpr), {
1439
+ deletedAt: ['deletedAt', current],
1440
+ _id: ['_id', assertNotNull(root().of('before').of('_id').expr())],
1441
+ touchedAt: ['touchedAt', current],
1442
+ })), x), ext, extExpr);
1443
+ };
1442
1444
  const $insert = (out) => $insertPart(out, {});
1443
1445
  const assertNotNull = (expr) => expr;
1444
1446
 
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.85",
6
+ "version": "0.0.86",
7
7
  "dependencies": {
8
8
  "dayjs": "^1.11.9",
9
9
  "dotenv": "^16.3.1",