Comparing version 1.1.0-exp.18 to 1.1.0-exp.19
@@ -727,3 +727,2 @@ "use strict"; | ||
to: () => t.ArrayString(t.Any()) | ||
// excludeRoot: true | ||
} | ||
@@ -730,0 +729,0 @@ ]; |
@@ -588,3 +588,2 @@ "use strict"; | ||
to: () => t.ArrayString(t.Any()) | ||
// excludeRoot: true | ||
} | ||
@@ -591,0 +590,0 @@ ]; |
@@ -718,3 +718,2 @@ "use strict"; | ||
to: () => t.ArrayString(t.Any()) | ||
// excludeRoot: true | ||
} | ||
@@ -721,0 +720,0 @@ ]; |
@@ -722,3 +722,2 @@ "use strict"; | ||
to: () => t.ArrayString(t.Any()) | ||
// excludeRoot: true | ||
} | ||
@@ -725,0 +724,0 @@ ]; |
@@ -229,3 +229,2 @@ "use strict"; | ||
to: () => t.ArrayString(t.Any()) | ||
// excludeRoot: true | ||
} | ||
@@ -232,0 +231,0 @@ ]; |
@@ -22,7 +22,12 @@ import type { BunFile } from 'bun'; | ||
}) => LifeCycleStore; | ||
export declare const replaceSchemaType: (schema: TSchema, options: MaybeArray<{ | ||
interface ReplaceSchemaTypeOptions { | ||
from: TSchema; | ||
to(): TSchema; | ||
excludeRoot?: boolean; | ||
}>, root?: boolean) => TSchema; | ||
/** | ||
* Traverse until object is found except root object | ||
**/ | ||
untilObjectFound?: boolean; | ||
} | ||
export declare const replaceSchemaType: (schema: TSchema, options: MaybeArray<ReplaceSchemaTypeOptions>, root?: boolean) => TSchema; | ||
export declare const getSchemaValidator: <T extends TSchema | string | undefined>(s: T, { models, dynamic, normalize, additionalProperties, coerce, additionalCoerce }?: { | ||
@@ -34,3 +39,3 @@ models?: Record<string, TSchema>; | ||
coerce?: boolean; | ||
additionalCoerce?: Parameters<typeof replaceSchemaType>[1]; | ||
additionalCoerce?: MaybeArray<ReplaceSchemaTypeOptions>; | ||
}) => T extends TSchema ? TypeCheck<TSchema> : undefined; | ||
@@ -47,3 +52,3 @@ export declare const getResponseSchemaValidator: (s: InputSchema["response"] | undefined, { models, dynamic, normalize, additionalProperties }: { | ||
to: () => import("@sinclair/typebox").TObject<{}>; | ||
excludeRoot: boolean; | ||
excludeRoot: true; | ||
} | { | ||
@@ -50,0 +55,0 @@ from: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny>; |
@@ -866,2 +866,4 @@ "use strict"; | ||
return schema; | ||
if (options.untilObjectFound && !root && schema.type === "object") | ||
return schema; | ||
const fromSymbol = options.from[import_typebox3.Kind]; | ||
@@ -1062,7 +1064,9 @@ if (schema.oneOf) { | ||
from: t.Number(), | ||
to: () => t.Numeric() | ||
to: () => t.Numeric(), | ||
untilObjectFound: true | ||
}, | ||
{ | ||
from: t.Boolean(), | ||
to: () => t.BooleanString() | ||
to: () => t.BooleanString(), | ||
untilObjectFound: true | ||
}, | ||
@@ -1156,12 +1160,2 @@ ...Array.isArray(additionalCoerce) ? additionalCoerce : [additionalCoerce] | ||
const compile = (schema, references) => { | ||
schema = replaceSchemaType(schema, [ | ||
{ | ||
from: t.Number(), | ||
to: () => t.Numeric() | ||
}, | ||
{ | ||
from: t.Boolean(), | ||
to: () => t.BooleanString() | ||
} | ||
]); | ||
const cleaner = (value) => import_value3.Value.Clean(schema, value); | ||
@@ -1227,3 +1221,2 @@ if (dynamic) | ||
to: () => t.ArrayString(t.Any()) | ||
// excludeRoot: true | ||
} | ||
@@ -1230,0 +1223,0 @@ ]; |
@@ -582,3 +582,2 @@ "use strict"; | ||
to: () => t.ArrayString(t.Any()) | ||
// excludeRoot: true | ||
} | ||
@@ -585,0 +584,0 @@ ]; |
@@ -22,7 +22,12 @@ import type { BunFile } from 'bun'; | ||
}) => LifeCycleStore; | ||
export declare const replaceSchemaType: (schema: TSchema, options: MaybeArray<{ | ||
interface ReplaceSchemaTypeOptions { | ||
from: TSchema; | ||
to(): TSchema; | ||
excludeRoot?: boolean; | ||
}>, root?: boolean) => TSchema; | ||
/** | ||
* Traverse until object is found except root object | ||
**/ | ||
untilObjectFound?: boolean; | ||
} | ||
export declare const replaceSchemaType: (schema: TSchema, options: MaybeArray<ReplaceSchemaTypeOptions>, root?: boolean) => TSchema; | ||
export declare const getSchemaValidator: <T extends TSchema | string | undefined>(s: T, { models, dynamic, normalize, additionalProperties, coerce, additionalCoerce }?: { | ||
@@ -34,3 +39,3 @@ models?: Record<string, TSchema>; | ||
coerce?: boolean; | ||
additionalCoerce?: Parameters<typeof replaceSchemaType>[1]; | ||
additionalCoerce?: MaybeArray<ReplaceSchemaTypeOptions>; | ||
}) => T extends TSchema ? TypeCheck<TSchema> : undefined; | ||
@@ -47,3 +52,3 @@ export declare const getResponseSchemaValidator: (s: InputSchema["response"] | undefined, { models, dynamic, normalize, additionalProperties }: { | ||
to: () => import("@sinclair/typebox").TObject<{}>; | ||
excludeRoot: boolean; | ||
excludeRoot: true; | ||
} | { | ||
@@ -50,0 +55,0 @@ from: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny>; |
{ | ||
"name": "elysia", | ||
"description": "Ergonomic Framework for Human", | ||
"version": "1.1.0-exp.18", | ||
"version": "1.1.0-exp.19", | ||
"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 too big to display
Sorry, the diff of this file is too big to display
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
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
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2467170
66
54087