@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.
- package/dist/lib/query.d.ts +1 -0
- package/dist/lib/query.js +5 -0
- package/package.json +1 -1
package/dist/lib/query.d.ts
CHANGED
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;
|