@inflector/optima 1.1.3 → 1.1.4

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 (2) hide show
  1. package/dist/index.js +7 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -624,15 +624,19 @@ ${valuesBlock}${isReturning ? "\nRETURNING *" : ""};`;
624
624
  if (PotentialyUpdated.length == 0) return [];
625
625
  else {
626
626
  const { sql } = this.BuildUpdate(this.Name, record, data);
627
- const Result = await (await this.Connection.run(sql)).getRowObjects();
627
+ const Result = this.FormatOut(await (await this.Connection.run(sql)).getRowObjects());
628
628
  if (Result.length != 0) {
629
+ const paired = PotentialyUpdated.map((oldItem, i) => ({
630
+ old: oldItem,
631
+ new: Result[i]
632
+ }));
629
633
  this.notifyChange({
630
634
  event: "Update",
631
- data: data.returning ? this.FormatOut(Result) : void 0,
635
+ data: data.returning ? paired : void 0,
632
636
  time: /* @__PURE__ */ new Date()
633
637
  });
634
638
  }
635
- return data.returning ? this.FormatOut(Result) : this.SafeParse(Result);
639
+ return data.returning ? Result : this.SafeParse(Result);
636
640
  }
637
641
  });
638
642
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inflector/optima",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "type": "module",
5
5
  "author": "Inflector",
6
6
  "main": "./dist/index.js",