Revision 0.8.8 (#18)
* Reverse Syntax Mapping * Minor Optimizations * Documentation
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user