Revision 0.8.8 (#18)

* Reverse Syntax Mapping

* Minor Optimizations

* Documentation
This commit is contained in:
sinclairzx81
2025-02-01 03:16:00 +09:00
committed by GitHub
parent 6af5fde768
commit b6d6ac7e8b
29 changed files with 753 additions and 232 deletions

View File

@@ -31,11 +31,12 @@ import * as t from '@sinclair/typebox'
// ------------------------------------------------------------------
// TypeBoxFromTypeBox
// ------------------------------------------------------------------
/** Creates a TypeBox type from TypeBox */
// prettier-ignore
export type TTypeBoxFromTypeBox<Type extends t.TSchema> = Type
/** Creates a TypeBox type from TypeBox */
// prettier-ignore
export function TypeBoxFromTypeBox<Type extends t.TSchema, Result extends TTypeBoxFromTypeBox<Type> = TTypeBoxFromTypeBox<Type>>(type: Type): Result {
return (t.KindGuard.IsSchema(type) ? type : t.Never()) as never
export function TypeBoxFromTypeBox<Type extends t.TSchema>(type: Type): TTypeBoxFromTypeBox<Type> {
return t.CloneType(type)
}