@omegup/msync 0.0.20 → 0.0.22

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
@@ -479,8 +479,9 @@ declare const $unwind: <T extends doc, K extends s, U extends doc>(k: AsLiteral<
479
479
 
480
480
  type Allowed$2<K extends string> = Exclude<K, keyof (TS & ID)>;
481
481
  type Patch<V, KK extends StrKey<V>> = ((OPick<V, Allowed$2<KK>> & ID) | (Rec<Allowed$2<KK>, N> & ID)) & TS;
482
- declare const $simpleMerge: <V extends O>() => <KK extends StrKey<V>, Out extends doc, E = unknown>(out: RWCollection<Out | Replace<Out, Patch<V, KK>>, Out>, keys: ExactKeys<Allowed$2<KK>>) => StreamRunnerParam<OPick<V, Allowed$2<KK>> & ID & E, "out">;
483
- declare const $merge: <V extends O>() => <KK extends StrKey<V>, Out extends doc>(out: RWCollection<Out | Replace<Out, Patch<V, KK>>, Out>, keys: ExactKeys<Allowed$2<KK>>) => StreamRunnerParam<Delta<OPick<V, Allowed$2<KK>> & ID>, "out">;
482
+ type TakeDoc<V, KK extends StrKey<V>> = OPick<V, Allowed$2<KK>> & ID;
483
+ declare const $simpleMerge: <V extends O>() => <KK extends StrKey<V>, Out extends doc, E = unknown>(out: RWCollection<Out | Replace<Out, Patch<V, KK>>, Out>, keys: ExprsExact<OPick<V, Allowed$2<KK>>, TakeDoc<V, KK>>) => StreamRunnerParam<OPick<V, Allowed$2<KK>> & ID & E, "out">;
484
+ declare const $merge: <V extends O>() => <KK extends StrKey<V>, Out extends doc>(out: RWCollection<Out | Replace<Out, Patch<V, KK>>, Out>, keys: ExprsExact<OPick<V, Allowed$2<KK>>, TakeDoc<V, KK>>) => StreamRunnerParam<Delta<OPick<V, Allowed$2<KK>> & ID>, "out">;
484
485
 
485
486
  type ND = {
486
487
  readonly deletedAt?: null;
package/index.esm.js CHANGED
@@ -1035,7 +1035,7 @@ const $replaceWith = (expr) => ({
1035
1035
 
1036
1036
  const $mergeX = (out, keys, f, map) => ({
1037
1037
  raw: (first) => {
1038
- const patch = mapExactToObject(keys, (_, k) => [k, f.of(k).expr()]);
1038
+ const patch = mapExact(keys, v => sub(v, f));
1039
1039
  const or = field(omitPick().backward(spread(patch, {
1040
1040
  _id: ['_id', f.of('_id').expr()],
1041
1041
  touchedAt: ['touchedAt', current],
@@ -1259,7 +1259,7 @@ const executes$1 = (view, input, streamName) => {
1259
1259
  ]).then(ts => next(step2_5(ts), 'handle teardown'));
1260
1260
  const step2_5 = ([same, exists]) => async () => {
1261
1261
  const handleTeardown = async (last) => {
1262
- if (!last.data.teardown)
1262
+ if (!last.data)
1263
1263
  return;
1264
1264
  const { collection: c, method: m, params: p } = last.data.teardown;
1265
1265
  const { collection, method, params } = {
@@ -1415,7 +1415,7 @@ const executes = (view, input, streamName) => {
1415
1415
  ]).then(ts => next(step2_5(ts), 'handle teardown'));
1416
1416
  const step2_5 = ([same, exists]) => async () => {
1417
1417
  const handleTeardown = async (last) => {
1418
- if (!last.data.teardown)
1418
+ if (!last.data)
1419
1419
  return;
1420
1420
  const { collection: c, method: m, params: p } = last.data.teardown;
1421
1421
  const { collection, method, params } = {
package/index.js CHANGED
@@ -1037,7 +1037,7 @@ const $replaceWith = (expr) => ({
1037
1037
 
1038
1038
  const $mergeX = (out, keys, f, map) => ({
1039
1039
  raw: (first) => {
1040
- const patch = mapExactToObject(keys, (_, k) => [k, f.of(k).expr()]);
1040
+ const patch = mapExact(keys, v => sub(v, f));
1041
1041
  const or = field(omitPick().backward(spread(patch, {
1042
1042
  _id: ['_id', f.of('_id').expr()],
1043
1043
  touchedAt: ['touchedAt', current],
@@ -1261,7 +1261,7 @@ const executes$1 = (view, input, streamName) => {
1261
1261
  ]).then(ts => next(step2_5(ts), 'handle teardown'));
1262
1262
  const step2_5 = ([same, exists]) => async () => {
1263
1263
  const handleTeardown = async (last) => {
1264
- if (!last.data.teardown)
1264
+ if (!last.data)
1265
1265
  return;
1266
1266
  const { collection: c, method: m, params: p } = last.data.teardown;
1267
1267
  const { collection, method, params } = {
@@ -1417,7 +1417,7 @@ const executes = (view, input, streamName) => {
1417
1417
  ]).then(ts => next(step2_5(ts), 'handle teardown'));
1418
1418
  const step2_5 = ([same, exists]) => async () => {
1419
1419
  const handleTeardown = async (last) => {
1420
- if (!last.data.teardown)
1420
+ if (!last.data)
1421
1421
  return;
1422
1422
  const { collection: c, method: m, params: p } = last.data.teardown;
1423
1423
  const { collection, method, params } = {
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.20",
6
+ "version": "0.0.22",
7
7
  "dependencies": {
8
8
  "dayjs": "^1.11.9",
9
9
  "dotenv": "^16.3.1",