Comparing version 0.0.0-dev.20201126001345 to 0.0.0-dev.20201126010257
@@ -31,4 +31,2 @@ interface SchemaBase { | ||
? "boolean" | ||
: T extends undefined | ||
? "undefined" | ||
: "object"; | ||
@@ -57,4 +55,2 @@ | ||
type UndefinedSchema = SchemaDeclaration<undefined>; | ||
type NumberSchema = SchemaDeclaration<number> & { | ||
@@ -215,3 +211,2 @@ multipleOf?: number; | ||
| (ValueType extends NumberSchema ? never : number) | ||
| (ValueType extends UndefinedSchema ? never : undefined) | ||
| (ValueType extends StringSchema ? never : string) | ||
@@ -246,4 +241,2 @@ | (ValueType extends BoolSchema ? never : boolean); | ||
? ResolveArray<ValueType> | ||
: SchemaType extends SchemaDeclaration<typeof undefined> | ||
? undefined | ||
: never; | ||
@@ -250,0 +243,0 @@ |
{ | ||
"name": "as-typed", | ||
"version": "0.0.0-dev.20201126001345", | ||
"version": "0.0.0-dev.20201126010257", | ||
"description": "Static TypeScript types from a literal JSONSchema type", | ||
@@ -5,0 +5,0 @@ "types": "index.d.ts", |
@@ -18,4 +18,2 @@ import { AsTyped } from "./index"; | ||
assert(_ as AsTyped<{ type: "undefined" }>, _ as undefined); | ||
assert( | ||
@@ -113,3 +111,3 @@ _ as AsTyped<{ | ||
_ as AsTyped<{ not: { type: "number" } }>, | ||
_ as string | boolean | object | any[] | null | undefined | ||
_ as string | boolean | object | any[] | null | ||
); | ||
@@ -119,3 +117,3 @@ | ||
_ as AsTyped<{ not: { type: "string" } }>, | ||
_ as number | boolean | object | any[] | null | undefined | ||
_ as number | boolean | object | any[] | null | ||
); | ||
@@ -122,0 +120,0 @@ |
32550
835