@dnax/core 0.64.5 → 0.64.7

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.
@@ -2023,9 +2023,9 @@ class useRest {
2023
2023
  }
2024
2024
  }
2025
2025
 
2026
- abortTransaction() {
2026
+ async abortTransaction() {
2027
2027
  if (this.#session) {
2028
- this.#session?.abortTransaction();
2028
+ await this.#session?.abortTransaction();
2029
2029
  }
2030
2030
  }
2031
2031
  async commitTransaction() {
@@ -241,22 +241,23 @@ function toBson<T>(
241
241
  function deepSetId(col: Collection, data: any) {
242
242
  if (col) {
243
243
  col?.fields?.map((f) => {
244
+ if (f?.type?.match(/(json|array)/) && data[f?.name]) {
244
245
 
245
- if(f?.type?.match(/(json|array)/) && data[f.name]) {
246
-
247
- if(f?.injectAutoId && f?.type=='array') {
246
+ if (f?.injectAutoId && f?.type == "array") {
248
247
  data[f.name]?.map((d, index) => {
249
- if(!d?._id){
250
- d._id = String(new ObjectId());
251
- }
248
+ if (!d?._id) {
249
+ d._id = String(new ObjectId());
250
+ }
252
251
  });
253
- }
252
+ }
254
253
 
255
- if(f?.injectAutoId && f?.type=='json') {
256
- if(!data[f.name]?._id){
257
- data[f.name]._id = String(new ObjectId());
258
- }
254
+ if (f?.injectAutoId && f?.type == "json") {
255
+ if (!data[f.name]?._id) {
256
+ data[f.name]._id = String(new ObjectId());
257
+ }
258
+ }
259
259
  }
260
+
260
261
 
261
262
  if (f?.type?.match(/(relationship|media)/) && data[f.name]) {
262
263
  if (typeof data[f.name] == "object" && !Array.isArray(data[f.name])) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnax/core",
3
- "version": "0.64.5",
3
+ "version": "0.64.7",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "bin": {