@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.
- package/dist/index.js +7 -3
- 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 ?
|
|
635
|
+
data: data.returning ? paired : void 0,
|
|
632
636
|
time: /* @__PURE__ */ new Date()
|
|
633
637
|
});
|
|
634
638
|
}
|
|
635
|
-
return data.returning ?
|
|
639
|
+
return data.returning ? Result : this.SafeParse(Result);
|
|
636
640
|
}
|
|
637
641
|
});
|
|
638
642
|
}
|