@cabloy/zod-query 1.0.13 → 1.0.15

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.
@@ -1 +1,2 @@
1
1
  export declare function coerceWithNil(data: any, fn?: Function): any;
2
+ export declare function getTypeName(schema: any): any;
package/dist/lib/query.js CHANGED
@@ -185,6 +185,8 @@ export function coerceWithNil(data, fn) {
185
185
  }
186
186
  function _getInnerType(schema) {
187
187
  let innerType = schema._def.innerType;
188
+ if (!innerType)
189
+ return schema;
188
190
  while (innerType._def.innerType) {
189
191
  innerType = innerType._def.innerType;
190
192
  }
@@ -198,6 +200,9 @@ function _getTypeName(schema) {
198
200
  }
199
201
  return typeName;
200
202
  }
203
+ export function getTypeName(schema) {
204
+ return _getTypeName(_getInnerType(schema));
205
+ }
201
206
  // function _coerce(instance, input, fn) {
202
207
  // if (instance._def.coerce !== false) {
203
208
  // if (instance._def.coerce === true) instance._def.coerce = undefined as any;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cabloy/zod-query",
3
3
  "type": "module",
4
- "version": "1.0.13",
4
+ "version": "1.0.15",
5
5
  "description": "zod-query",
6
6
  "publishConfig": {
7
7
  "access": "public"