Comparing version 0.0.0-dev.20210203020211 to 0.0.0-dev.20210203020833
@@ -172,3 +172,3 @@ declare namespace AsTypedInternal { | ||
: Tuple extends [infer A, ...infer Rest] | ||
? [ResolveRecursiveInternal<A>, ...AsTypedTupleSchema<Rest>] | ||
? [ResolveRecursive<A>, ...AsTypedTupleSchema<Rest>] | ||
: never; | ||
@@ -181,6 +181,3 @@ | ||
? AsTypedTupleSchema<Tuple> | ||
: [ | ||
...AsTypedTupleSchema<Tuple>, | ||
...Array<ResolveRecursiveInternal<Additional>> | ||
]; | ||
: [...AsTypedTupleSchema<Tuple>, ...Array<ResolveRecursive<Additional>>]; | ||
@@ -196,6 +193,6 @@ type ResolveNot<ValueType> = | ||
type ResolveRecursiveInternal<SchemaType> = SchemaType extends { | ||
type ResolveRecursive<SchemaType> = SchemaType extends { | ||
nullable: true; | ||
} | ||
? ResolveRecursiveInternal<Omit<SchemaType, "nullable">> | null | ||
? ResolveRecursive<Omit<SchemaType, "nullable">> | null | ||
: SchemaType extends SchemaDeclaration<"null"> | ||
@@ -232,3 +229,3 @@ ? null | ||
} | ||
? ResolveRecursiveInternal<Omit<SchemaType, "type"> & { type: Type }> | ||
? ResolveRecursive<Omit<SchemaType, "type"> & { type: Type }> | ||
: SchemaType extends { | ||
@@ -238,16 +235,14 @@ type: [infer Type, ...infer Rest]; | ||
? | ||
| ResolveRecursiveInternal<Omit<SchemaType, "type"> & { type: Type }> | ||
| ResolveRecursiveInternal<Omit<SchemaType, "type"> & { type: Rest }> | ||
| ResolveRecursive<Omit<SchemaType, "type"> & { type: Type }> | ||
| ResolveRecursive<Omit<SchemaType, "type"> & { type: Rest }> | ||
: SchemaType extends OneOf<infer Inner> | ||
? ResolveRecursiveInternal<Inner> | ||
? ResolveRecursive<Inner> | ||
: SchemaType extends AnyOf<infer Inner> | ||
? ResolveRecursiveInternal<Inner> | ||
? ResolveRecursive<Inner> | ||
: SchemaType extends AllOf<infer Inner> | ||
? ResolveRecursiveInternal<UnionToIntersection<Inner>> | ||
? ResolveRecursive<UnionToIntersection<Inner>> | ||
: SchemaType extends IfThenElseSchema<infer If, infer Then, infer Else> | ||
? ResolveRecursiveInternal<(If & Then) | Else> | ||
? ResolveRecursive<(If & Then) | Else> | ||
: SchemaType; | ||
type ResolveRecursive<SchemaType> = ResolveRecursiveInternal<SchemaType>; | ||
type MapPropsToRefs<RootSchema, Props> = { | ||
@@ -254,0 +249,0 @@ [name in keyof Props]: ResolveRefs<RootSchema, Props[name]>; |
{ | ||
"name": "as-typed", | ||
"version": "0.0.0-dev.20210203020211", | ||
"version": "0.0.0-dev.20210203020833", | ||
"description": "Static TypeScript types from a literal JSONSchema type", | ||
@@ -5,0 +5,0 @@ "types": "index.d.ts", |
34742
894