Comparing version 1.2.20 to 1.2.21
@@ -239,2 +239,19 @@ "use strict"; | ||
if (!schema) return false; | ||
if (schema.oneOf) { | ||
for (let i = 0; i < schema.oneOf.length; i++) | ||
if (hasRef(schema.oneOf[i])) return true; | ||
} | ||
if (schema.anyOf) { | ||
for (let i = 0; i < schema.anyOf.length; i++) | ||
if (hasRef(schema.anyOf[i])) return true; | ||
} | ||
if (schema.oneOf) { | ||
for (let i = 0; i < schema.oneOf.length; i++) | ||
if (hasRef(schema.oneOf[i])) return true; | ||
} | ||
if (schema.allOf) { | ||
for (let i = 0; i < schema.allOf.length; i++) | ||
if (hasRef(schema.allOf[i])) return true; | ||
} | ||
if (schema.not && hasRef(schema.not)) return true; | ||
if (schema.type === "object" && schema.properties) { | ||
@@ -244,43 +261,10 @@ const properties = schema.properties; | ||
const property = properties[key]; | ||
if (property.type === "object") { | ||
if (hasRef(property)) return true; | ||
} else { | ||
if (property.anyOf) { | ||
for (let i = 0; i < property.anyOf.length; i++) | ||
if (hasRef(property.anyOf[i])) return true; | ||
} | ||
if (property.oneOf) { | ||
for (let i = 0; i < property.oneOf.length; i++) | ||
if (hasRef(property.oneOf[i])) return true; | ||
} | ||
if (property.allOf) { | ||
for (let i = 0; i < property.allOf.length; i++) | ||
if (hasRef(property.allOf[i])) return true; | ||
} | ||
} | ||
if (property[import_typebox.Kind] === "Ref" && "$ref" in property) return true; | ||
if (property.type === "array" && property.items) { | ||
const item = property.items; | ||
if (item.type === "object") { | ||
if (hasRef(item)) return true; | ||
} else { | ||
if (item.anyOf) { | ||
for (let i = 0; i < item.anyOf.length; i++) | ||
if (hasRef(item.anyOf[i])) return true; | ||
} | ||
if (item.oneOf) { | ||
for (let i = 0; i < item.oneOf.length; i++) | ||
if (hasRef(item.oneOf[i])) return true; | ||
} | ||
if (item.allOf) { | ||
for (let i = 0; i < item.allOf.length; i++) | ||
if (hasRef(item.allOf[i])) return true; | ||
} | ||
} | ||
if (item[import_typebox.Kind] === "Ref" && "$ref" in item) return true; | ||
} | ||
if (hasRef(property)) return true; | ||
if (property.type === "array" && property.items && hasRef(property.items)) | ||
return true; | ||
} | ||
return false; | ||
} | ||
if (schema.type === "array" && schema.items) return hasRef(schema.items); | ||
if (schema.type === "array" && schema.items && hasRef(schema.items)) | ||
return true; | ||
return schema[import_typebox.Kind] === "Ref" && "$ref" in schema; | ||
@@ -292,2 +276,15 @@ }; | ||
return hasTransform(schema.$defs[schema.$ref]); | ||
if (schema.oneOf) { | ||
for (let i = 0; i < schema.oneOf.length; i++) | ||
if (hasTransform(schema.oneOf[i])) return true; | ||
} | ||
if (schema.anyOf) { | ||
for (let i = 0; i < schema.anyOf.length; i++) | ||
if (hasTransform(schema.anyOf[i])) return true; | ||
} | ||
if (schema.allOf) { | ||
for (let i = 0; i < schema.allOf.length; i++) | ||
if (hasTransform(schema.allOf[i])) return true; | ||
} | ||
if (schema.not && hasTransform(schema.not)) return true; | ||
if (schema.type === "object" && schema.properties) { | ||
@@ -297,45 +294,11 @@ const properties = schema.properties; | ||
const property = properties[key]; | ||
if (property.type === "object") { | ||
if (hasTransform(property)) return true; | ||
} else { | ||
if (property.anyOf) { | ||
for (let i = 0; i < property.anyOf.length; i++) | ||
if (hasTransform(property.anyOf[i])) return true; | ||
} | ||
if (property.allOf) { | ||
for (let i = 0; i < property.allOf.length; i++) | ||
if (hasTransform(property.allOf[i])) return true; | ||
} | ||
if (property.oneOf) { | ||
for (let i = 0; i < property.oneOf.length; i++) | ||
if (hasTransform(property.oneOf[i])) return true; | ||
} | ||
} | ||
if (TransformSymbol in property) return true; | ||
if (property.type === "array" && property.items) { | ||
const item = property.items; | ||
if (item.type === "object") { | ||
if (hasTransform(item)) return true; | ||
} else { | ||
if (item.anyOf) { | ||
for (let i = 0; i < item.anyOf.length; i++) | ||
if (hasTransform(item.anyOf[i])) return true; | ||
} | ||
if (item.oneOf) { | ||
for (let i = 0; i < item.oneOf.length; i++) | ||
if (hasTransform(item.oneOf[i])) return true; | ||
} | ||
if (item.allOf) { | ||
for (let i = 0; i < item.allOf.length; i++) | ||
if (hasTransform(item.allOf[i])) return true; | ||
} | ||
} | ||
if (TransformSymbol in item) return true; | ||
} | ||
if (hasTransform(property)) return true; | ||
if (property.type === "array" && property.items && hasTransform(property.items)) | ||
return true; | ||
} | ||
return false; | ||
} | ||
if (schema.type === "array" && schema.items) | ||
return hasTransform(schema.items); | ||
return TransformSymbol in schema || schema.properties && TransformSymbol in schema.properties; | ||
if (schema.type === "array" && schema.items && hasTransform(schema.items)) | ||
return true; | ||
return TransformSymbol in schema || !!schema.properties && TransformSymbol in schema.properties; | ||
}; | ||
@@ -342,0 +305,0 @@ const matchFnReturn = /(?:return|=>) \S+\(/g; |
@@ -260,7 +260,3 @@ "use strict"; | ||
} | ||
if (schema.not) { | ||
for (let i = 0; i < schema.not.length; i++) | ||
schema.not[i] = _replaceSchemaType(schema.not[i], options, root); | ||
return schema; | ||
} | ||
if (schema.not) return _replaceSchemaType(schema.not, options, root); | ||
const isRoot = root && !!options.excludeRoot; | ||
@@ -343,5 +339,3 @@ if (schema[import_typebox.Kind] === fromSymbol) { | ||
to.allOf[i] = composeProperties(to.allOf[i]); | ||
else if (to.not) | ||
for (let i = 0; i < to.not.length; i++) | ||
to.not[i] = composeProperties(to.not[i]); | ||
else if (to.not) to.not = composeProperties(to.not); | ||
if (transform) to[import_typebox.TransformKind] = transform[import_typebox.TransformKind]; | ||
@@ -392,5 +386,3 @@ if (to.anyOf || to.oneOf || to.allOf || to.not) return to; | ||
to.allOf[i] = { ...rest, ...to.allOf[i] }; | ||
else if (to.not) | ||
for (let i = 0; i < to.not.length; i++) | ||
to.not[i] = { ...rest, ...to.not[i] }; | ||
else if (to.not) to.not = { ...rest, ...to.not }; | ||
properties[key] = { | ||
@@ -397,0 +389,0 @@ ...rest, |
{ | ||
"name": "elysia", | ||
"description": "Ergonomic Framework for Human", | ||
"version": "1.2.20", | ||
"version": "1.2.21", | ||
"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
Sorry, the diff of this file is not supported yet
1907431
30525