imean-cassandra-orm 2.7.1 → 2.7.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/mod.cjs CHANGED
@@ -1030,8 +1030,10 @@ function convertValueFromCassandra(value, config, zodSchema, filedName) {
1030
1030
  case "blob":
1031
1031
  return value instanceof Uint8Array ? value : new Uint8Array(value);
1032
1032
  case "text":
1033
- const zodTypeName = zodSchema?.shape[filedName]?._def?.typeName;
1034
- if (config.type !== "text" || zodTypeName === "ZodAny" || zodTypeName === "ZodObject") {
1033
+ let zodField = zodSchema?.shape[filedName];
1034
+ zodField = zodField?._def?.innerType ?? zodField;
1035
+ const zodTypeName = zodField?._def?.typeName;
1036
+ if (config.type !== "text" || zodTypeName !== "ZodString") {
1035
1037
  try {
1036
1038
  return JSON.parse(value);
1037
1039
  } catch (error) {
package/dist/mod.js CHANGED
@@ -1028,8 +1028,10 @@ function convertValueFromCassandra(value, config, zodSchema, filedName) {
1028
1028
  case "blob":
1029
1029
  return value instanceof Uint8Array ? value : new Uint8Array(value);
1030
1030
  case "text":
1031
- const zodTypeName = zodSchema?.shape[filedName]?._def?.typeName;
1032
- if (config.type !== "text" || zodTypeName === "ZodAny" || zodTypeName === "ZodObject") {
1031
+ let zodField = zodSchema?.shape[filedName];
1032
+ zodField = zodField?._def?.innerType ?? zodField;
1033
+ const zodTypeName = zodField?._def?.typeName;
1034
+ if (config.type !== "text" || zodTypeName !== "ZodString") {
1033
1035
  try {
1034
1036
  return JSON.parse(value);
1035
1037
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imean-cassandra-orm",
3
- "version": "2.7.1",
3
+ "version": "2.7.2",
4
4
  "description": "cassandra orm",
5
5
  "keywords": [
6
6
  "cassandra",