@omegup/msync 0.0.84 → 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 +2 -2
- package/index.esm.js +11 -8
- package/index.js +11 -8
- package/package.json +1 -1
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
|
|
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
|
|
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,7 +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) => {
|
|
1406
|
+
const $insertX = (out, expr, map, ext, extExpr) => {
|
|
1407
1407
|
const filter = mapExactToObject(ext, v => ({ $eq: v }));
|
|
1408
1408
|
return {
|
|
1409
1409
|
teardown: c => c({
|
|
@@ -1415,7 +1415,7 @@ const $insertX = (out, expr, map, ext) => {
|
|
|
1415
1415
|
],
|
|
1416
1416
|
}),
|
|
1417
1417
|
raw: () => {
|
|
1418
|
-
const replacer = map(mergeObjects(expr, field(mergeExpr(
|
|
1418
|
+
const replacer = map(mergeObjects(expr, field(mergeExpr(extExpr, {
|
|
1419
1419
|
deletedAt: ['deletedAt', nil],
|
|
1420
1420
|
touchedAt: ['touchedAt', current],
|
|
1421
1421
|
}))));
|
|
@@ -1430,12 +1430,15 @@ const $insertX = (out, expr, map, ext) => {
|
|
|
1430
1430
|
},
|
|
1431
1431
|
};
|
|
1432
1432
|
};
|
|
1433
|
-
const $simpleInsert = (out) => $insertX(out, root().expr(), id$1, {});
|
|
1434
|
-
const $insertPart = (out, ext) =>
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
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
|
+
};
|
|
1439
1442
|
const $insert = (out) => $insertPart(out, {});
|
|
1440
1443
|
const assertNotNull = (expr) => expr;
|
|
1441
1444
|
|
package/index.js
CHANGED
|
@@ -1405,7 +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) => {
|
|
1408
|
+
const $insertX = (out, expr, map, ext, extExpr) => {
|
|
1409
1409
|
const filter = mapExactToObject(ext, v => ({ $eq: v }));
|
|
1410
1410
|
return {
|
|
1411
1411
|
teardown: c => c({
|
|
@@ -1417,7 +1417,7 @@ const $insertX = (out, expr, map, ext) => {
|
|
|
1417
1417
|
],
|
|
1418
1418
|
}),
|
|
1419
1419
|
raw: () => {
|
|
1420
|
-
const replacer = map(mergeObjects(expr, field(mergeExpr(
|
|
1420
|
+
const replacer = map(mergeObjects(expr, field(mergeExpr(extExpr, {
|
|
1421
1421
|
deletedAt: ['deletedAt', nil],
|
|
1422
1422
|
touchedAt: ['touchedAt', current],
|
|
1423
1423
|
}))));
|
|
@@ -1432,12 +1432,15 @@ const $insertX = (out, expr, map, ext) => {
|
|
|
1432
1432
|
},
|
|
1433
1433
|
};
|
|
1434
1434
|
};
|
|
1435
|
-
const $simpleInsert = (out) => $insertX(out, root().expr(), id$1, {});
|
|
1436
|
-
const $insertPart = (out, ext) =>
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
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
|
+
};
|
|
1441
1444
|
const $insert = (out) => $insertPart(out, {});
|
|
1442
1445
|
const assertNotNull = (expr) => expr;
|
|
1443
1446
|
|