Comparing version 1.2.21 to 1.2.22
@@ -178,10 +178,9 @@ "use strict"; | ||
`; | ||
if (encodeSchema && // @ts-expect-error hasTransform is appended by getResponseSchemaValidator | ||
(value.hasTransform || typeof value.Decode === "function")) | ||
code += `${name}=validator.response['${status}'].Encode(${name}) | ||
`; | ||
code += `if(validator.response['${status}'].Check(${name})===false){c.set.status=422 | ||
throw new ValidationError('response',validator.response['${status}'],${name})}c.set.status = ${status}} | ||
`; | ||
if (encodeSchema && // @ts-expect-error hasTransform is appended by getResponseSchemaValidator | ||
(value.hasTransform || typeof value.Decode === "function")) { | ||
code += `${name}=validator.response['${status}'].Encode(${name}) | ||
`; | ||
} | ||
code += "break\n"; | ||
@@ -265,3 +264,2 @@ } | ||
} | ||
return false; | ||
} | ||
@@ -274,4 +272,4 @@ if (schema.type === "array" && schema.items && hasRef(schema.items)) | ||
if (!schema) return false; | ||
if (schema.$ref && schema.$defs && schema.$ref in schema.$defs) | ||
return hasTransform(schema.$defs[schema.$ref]); | ||
if (schema.$ref && schema.$defs && schema.$ref in schema.$defs && hasTransform(schema.$defs[schema.$ref])) | ||
return true; | ||
if (schema.oneOf) { | ||
@@ -298,7 +296,6 @@ for (let i = 0; i < schema.oneOf.length; i++) | ||
} | ||
return false; | ||
} | ||
if (schema.type === "array" && schema.items && hasTransform(schema.items)) | ||
return true; | ||
return TransformSymbol in schema || !!schema.properties && TransformSymbol in schema.properties; | ||
return TransformSymbol in schema; | ||
}; | ||
@@ -305,0 +302,0 @@ const matchFnReturn = /(?:return|=>) \S+\(/g; |
{ | ||
"name": "elysia", | ||
"description": "Ergonomic Framework for Human", | ||
"version": "1.2.21", | ||
"version": "1.2.22", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "saltyAom", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1907032
30519