@zenstackhq/orm 3.0.0-beta.29 → 3.0.0-beta.31

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 CHANGED
@@ -1510,7 +1510,13 @@ var PostgresCrudDialect = class extends BaseCrudDialect {
1510
1510
  } else if (value instanceof AnyNullClass) {
1511
1511
  invariant3(false, "should not reach here: AnyNull is not a valid input value");
1512
1512
  }
1513
- if (Array.isArray(value)) {
1513
+ if (isTypeDef(this.schema, type)) {
1514
+ if (typeof value !== "string") {
1515
+ return JSON.stringify(value);
1516
+ } else {
1517
+ return value;
1518
+ }
1519
+ } else if (Array.isArray(value)) {
1514
1520
  if (type === "Json" && !forArrayField) {
1515
1521
  return JSON.stringify(value);
1516
1522
  } else {