@inflector/optima 1.1.1 → 1.1.2
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.d.ts +1 -1
- package/dist/index.js +5 -18
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -147,7 +147,7 @@ declare class OptimaTable<TDef extends Record<string, any> = any> {
|
|
|
147
147
|
*/
|
|
148
148
|
Subscribe(fn: (change: {
|
|
149
149
|
event: "Add" | "AddMany" | "Delete" | "Update";
|
|
150
|
-
data: Partial<Infer<TDef
|
|
150
|
+
data: Partial<Infer<TDef>> | Partial<Infer<TDef>>[];
|
|
151
151
|
time: Date;
|
|
152
152
|
}) => void): Unsubscribe;
|
|
153
153
|
private InitTable;
|
package/dist/index.js
CHANGED
|
@@ -626,24 +626,11 @@ ${valuesBlock}${isReturning ? "\nRETURNING *" : ""};`;
|
|
|
626
626
|
const { sql } = this.BuildUpdate(this.Name, record, data);
|
|
627
627
|
const Result = await (await this.Connection.run(sql)).getRowObjects();
|
|
628
628
|
if (Result.length != 0) {
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
});
|
|
635
|
-
} else {
|
|
636
|
-
const Updated = PotentialyUpdated;
|
|
637
|
-
const UpdatedPromises = Updated.map(
|
|
638
|
-
async (record2) => await this.GetOne().where(record2)
|
|
639
|
-
);
|
|
640
|
-
const UpdatedRecords = await Promise.all(UpdatedPromises);
|
|
641
|
-
this.notifyChange({
|
|
642
|
-
event: "Update",
|
|
643
|
-
data: UpdatedRecords,
|
|
644
|
-
time: /* @__PURE__ */ new Date()
|
|
645
|
-
});
|
|
646
|
-
}
|
|
629
|
+
this.notifyChange({
|
|
630
|
+
event: "Update",
|
|
631
|
+
data: data.returning ? this.FormatOut(Result) : void 0,
|
|
632
|
+
time: /* @__PURE__ */ new Date()
|
|
633
|
+
});
|
|
647
634
|
}
|
|
648
635
|
return data.returning ? this.FormatOut(Result) : this.SafeParse(Result);
|
|
649
636
|
}
|