Test case
1 generated file · +3 −3test/inputs/json/misc/00c36.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -17,7 +17,7 @@ export type Value = z.infer<typeof ValueSchema>; | ||
| 17 | 17 | export const CountrySchema = z.object({ |
| 18 | 18 | "id": IdSchema, |
| 19 | 19 | "value": ValueSchema, |
| 20 | -}); | |
| 20 | +}).strict(); | |
| 21 | 21 | export type Country = z.infer<typeof CountrySchema>; |
| 22 | 22 | |
| 23 | 23 | export const FluffyTopLevelSchema = z.object({ |
| @@ -25,7 +25,7 @@ export const FluffyTopLevelSchema = z.object({ | ||
| 25 | 25 | "pages": z.number().int(), |
| 26 | 26 | "per_page": z.string().regex(/^-?\d+$/), |
| 27 | 27 | "total": z.number().int(), |
| 28 | -}); | |
| 28 | +}).strict(); | |
| 29 | 29 | export type FluffyTopLevel = z.infer<typeof FluffyTopLevelSchema>; |
| 30 | 30 | |
| 31 | 31 | export const PurpleTopLevelSchema = z.object({ |
| @@ -34,7 +34,7 @@ export const PurpleTopLevelSchema = z.object({ | ||
| 34 | 34 | "decimal": z.string().regex(/^-?\d+$/), |
| 35 | 35 | "indicator": CountrySchema, |
| 36 | 36 | "value": z.string(), |
| 37 | -}); | |
| 37 | +}).strict(); | |
| 38 | 38 | export type PurpleTopLevel = z.infer<typeof PurpleTopLevelSchema>; |
| 39 | 39 | |
| 40 | 40 | export const TopLevelSchema = z.array(z.union([z.array(PurpleTopLevelSchema), FluffyTopLevelSchema])); |
Test case
1 generated file · +12 −12test/inputs/json/misc/00ec5.json
Mtypescript-zoddefault / TopLevel.ts+12 −12
| @@ -9,14 +9,14 @@ export type Type = z.infer<typeof TypeSchema>; | ||
| 9 | 9 | export const PropertySchema = z.object({ |
| 10 | 10 | "description": z.string(), |
| 11 | 11 | "type": TypeSchema, |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type Property = z.infer<typeof PropertySchema>; |
| 14 | 14 | |
| 15 | 15 | export const InfoSchema = z.object({ |
| 16 | 16 | "description": z.string(), |
| 17 | 17 | "title": z.string(), |
| 18 | 18 | "version": z.string(), |
| 19 | -}); | |
| 19 | +}).strict(); | |
| 20 | 20 | export type Info = z.infer<typeof InfoSchema>; |
| 21 | 21 | |
| 22 | 22 | export const ParameterSchema = z.object({ |
| @@ -26,33 +26,33 @@ export const ParameterSchema = z.object({ | ||
| 26 | 26 | "name": z.string(), |
| 27 | 27 | "required": z.boolean(), |
| 28 | 28 | "type": TypeSchema, |
| 29 | -}); | |
| 29 | +}).strict(); | |
| 30 | 30 | export type Parameter = z.infer<typeof ParameterSchema>; |
| 31 | 31 | |
| 32 | 32 | export const SchemaSchema = z.object({ |
| 33 | 33 | "$ref": z.string(), |
| 34 | -}); | |
| 34 | +}).strict(); | |
| 35 | 35 | export type Schema = z.infer<typeof SchemaSchema>; |
| 36 | 36 | |
| 37 | 37 | export const ProviderSchema = z.object({ |
| 38 | 38 | "properties": z.record(z.string(), PropertySchema), |
| 39 | -}); | |
| 39 | +}).strict(); | |
| 40 | 40 | export type Provider = z.infer<typeof ProviderSchema>; |
| 41 | 41 | |
| 42 | 42 | export const The200Schema = z.object({ |
| 43 | 43 | "description": z.string(), |
| 44 | 44 | "schema": SchemaSchema, |
| 45 | -}); | |
| 45 | +}).strict(); | |
| 46 | 46 | export type The200 = z.infer<typeof The200Schema>; |
| 47 | 47 | |
| 48 | 48 | export const DefinitionsSchema = z.object({ |
| 49 | 49 | "Provider": ProviderSchema, |
| 50 | -}); | |
| 50 | +}).strict(); | |
| 51 | 51 | export type Definitions = z.infer<typeof DefinitionsSchema>; |
| 52 | 52 | |
| 53 | 53 | export const ResponsesSchema = z.object({ |
| 54 | 54 | "200": The200Schema, |
| 55 | -}); | |
| 55 | +}).strict(); | |
| 56 | 56 | export type Responses = z.infer<typeof ResponsesSchema>; |
| 57 | 57 | |
| 58 | 58 | export const GetSchema = z.object({ |
| @@ -61,17 +61,17 @@ export const GetSchema = z.object({ | ||
| 61 | 61 | "responses": ResponsesSchema, |
| 62 | 62 | "summary": z.string(), |
| 63 | 63 | "tags": z.array(z.string()), |
| 64 | -}); | |
| 64 | +}).strict(); | |
| 65 | 65 | export type Get = z.infer<typeof GetSchema>; |
| 66 | 66 | |
| 67 | 67 | export const BusinessServiceProvidersSearchSchema = z.object({ |
| 68 | 68 | "get": GetSchema, |
| 69 | -}); | |
| 69 | +}).strict(); | |
| 70 | 70 | export type BusinessServiceProvidersSearch = z.infer<typeof BusinessServiceProvidersSearchSchema>; |
| 71 | 71 | |
| 72 | 72 | export const PathsSchema = z.object({ |
| 73 | 73 | "/business_service_providers/search": BusinessServiceProvidersSearchSchema, |
| 74 | -}); | |
| 74 | +}).strict(); | |
| 75 | 75 | export type Paths = z.infer<typeof PathsSchema>; |
| 76 | 76 | |
| 77 | 77 | export const TopLevelSchema = z.object({ |
| @@ -83,5 +83,5 @@ export const TopLevelSchema = z.object({ | ||
| 83 | 83 | "produces": z.array(z.string()), |
| 84 | 84 | "schemes": z.array(z.string()), |
| 85 | 85 | "swagger": z.string(), |
| 86 | -}); | |
| 86 | +}).strict(); | |
| 87 | 87 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/010b1.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -13,7 +13,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 13 | 13 | "males": z.number().int(), |
| 14 | 14 | "total": z.number().int(), |
| 15 | 15 | "year": z.number().int(), |
| 16 | -}); | |
| 16 | +}).strict(); | |
| 17 | 17 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 18 | 18 | |
| 19 | 19 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +2 −2test/inputs/json/misc/016af.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -4,10 +4,10 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TotalPopulationSchema = z.object({ |
| 5 | 5 | "date": z.string(), |
| 6 | 6 | "population": z.number().int(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type TotalPopulation = z.infer<typeof TotalPopulationSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "total_population": z.array(TotalPopulationSchema), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/033b1.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -5,5 +5,5 @@ export const TopLevelSchema = z.object({ | ||
| 5 | 5 | "base": z.string(), |
| 6 | 6 | "date": z.string(), |
| 7 | 7 | "rates": z.record(z.string(), z.number()), |
| 8 | -}); | |
| 8 | +}).strict(); | |
| 9 | 9 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +5 −5test/inputs/json/misc/050b0.json
Mtypescript-zoddefault / TopLevel.ts+5 −5
| @@ -44,26 +44,26 @@ export type Title = z.infer<typeof TitleSchema>; | ||
| 44 | 44 | export const IdentifierSchema = z.object({ |
| 45 | 45 | "identifier": z.string(), |
| 46 | 46 | "scheme": SchemeSchema, |
| 47 | -}); | |
| 47 | +}).strict(); | |
| 48 | 48 | export type Identifier = z.infer<typeof IdentifierSchema>; |
| 49 | 49 | |
| 50 | 50 | export const LinkSchema = z.object({ |
| 51 | 51 | "note": NoteSchema, |
| 52 | 52 | "url": z.string(), |
| 53 | -}); | |
| 53 | +}).strict(); | |
| 54 | 54 | export type Link = z.infer<typeof LinkSchema>; |
| 55 | 55 | |
| 56 | 56 | export const OtherNameSchema = z.object({ |
| 57 | 57 | "name": z.string(), |
| 58 | 58 | "note": z.union([z.null(), z.string()]), |
| 59 | -}); | |
| 59 | +}).strict(); | |
| 60 | 60 | export type OtherName = z.infer<typeof OtherNameSchema>; |
| 61 | 61 | |
| 62 | 62 | export const TextSchema = z.object({ |
| 63 | 63 | "media_type": MediaTypeSchema, |
| 64 | 64 | "title": TitleSchema, |
| 65 | 65 | "url": z.string(), |
| 66 | -}); | |
| 66 | +}).strict(); | |
| 67 | 67 | export type Text = z.infer<typeof TextSchema>; |
| 68 | 68 | |
| 69 | 69 | export const TopLevelElementSchema = z.object({ |
| @@ -75,7 +75,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 75 | 75 | "other_names": z.array(OtherNameSchema), |
| 76 | 76 | "superseded_by": z.union([z.null(), z.string()]), |
| 77 | 77 | "text": z.array(TextSchema), |
| 78 | -}); | |
| 78 | +}).strict(); | |
| 79 | 79 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 80 | 80 | |
| 81 | 81 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +4 −4test/inputs/json/misc/06bee.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -37,20 +37,20 @@ export type Title = z.infer<typeof TitleSchema>; | ||
| 37 | 37 | export const IdentifierSchema = z.object({ |
| 38 | 38 | "identifier": z.string(), |
| 39 | 39 | "scheme": SchemeSchema, |
| 40 | -}); | |
| 40 | +}).strict(); | |
| 41 | 41 | export type Identifier = z.infer<typeof IdentifierSchema>; |
| 42 | 42 | |
| 43 | 43 | export const LinkSchema = z.object({ |
| 44 | 44 | "note": NoteSchema, |
| 45 | 45 | "url": z.string(), |
| 46 | -}); | |
| 46 | +}).strict(); | |
| 47 | 47 | export type Link = z.infer<typeof LinkSchema>; |
| 48 | 48 | |
| 49 | 49 | export const TextSchema = z.object({ |
| 50 | 50 | "media_type": MediaTypeSchema, |
| 51 | 51 | "title": TitleSchema, |
| 52 | 52 | "url": z.string(), |
| 53 | -}); | |
| 53 | +}).strict(); | |
| 54 | 54 | export type Text = z.infer<typeof TextSchema>; |
| 55 | 55 | |
| 56 | 56 | export const TopLevelElementSchema = z.object({ |
| @@ -62,7 +62,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 62 | 62 | "other_names": z.array(z.any()), |
| 63 | 63 | "superseded_by": z.null(), |
| 64 | 64 | "text": z.array(TextSchema), |
| 65 | -}); | |
| 65 | +}).strict(); | |
| 66 | 66 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 67 | 67 | |
| 68 | 68 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +2 −2test/inputs/json/misc/07540.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -2,10 +2,10 @@ import * as z from "zod"; | ||
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | export const CookiesSchema = z.object({ |
| 5 | -}); | |
| 5 | +}).strict(); | |
| 6 | 6 | export type Cookies = z.infer<typeof CookiesSchema>; |
| 7 | 7 | |
| 8 | 8 | export const TopLevelSchema = z.object({ |
| 9 | 9 | "cookies": CookiesSchema, |
| 10 | -}); | |
| 10 | +}).strict(); | |
| 11 | 11 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/misc/0779f.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -11,14 +11,14 @@ export const StatusSchema = z.object({ | ||
| 11 | 11 | "reason": z.string(), |
| 12 | 12 | "trend": z.string(), |
| 13 | 13 | "type": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Status = z.infer<typeof StatusSchema>; |
| 16 | 16 | |
| 17 | 17 | export const MetaSchema = z.object({ |
| 18 | 18 | "credit": z.string(), |
| 19 | 19 | "updated": z.string(), |
| 20 | 20 | "url": z.string(), |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type Meta = z.infer<typeof MetaSchema>; |
| 23 | 23 | |
| 24 | 24 | export const WeatherSchema = z.object({ |
| @@ -27,7 +27,7 @@ export const WeatherSchema = z.object({ | ||
| 27 | 27 | "visibility": z.number(), |
| 28 | 28 | "weather": z.string(), |
| 29 | 29 | "wind": z.string(), |
| 30 | -}); | |
| 30 | +}).strict(); | |
| 31 | 31 | export type Weather = z.infer<typeof WeatherSchema>; |
| 32 | 32 | |
| 33 | 33 | export const TopLevelSchema = z.object({ |
| @@ -39,5 +39,5 @@ export const TopLevelSchema = z.object({ | ||
| 39 | 39 | "state": z.string(), |
| 40 | 40 | "status": StatusSchema, |
| 41 | 41 | "weather": WeatherSchema, |
| 42 | -}); | |
| 42 | +}).strict(); | |
| 43 | 43 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/misc/07c75.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -4,20 +4,20 @@ import * as z from "zod"; | ||
| 4 | 4 | export const IdentifierSchema = z.object({ |
| 5 | 5 | "identifier": z.string(), |
| 6 | 6 | "scheme": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Identifier = z.infer<typeof IdentifierSchema>; |
| 9 | 9 | |
| 10 | 10 | export const LinkSchema = z.object({ |
| 11 | 11 | "note": z.string(), |
| 12 | 12 | "url": z.string(), |
| 13 | -}); | |
| 13 | +}).strict(); | |
| 14 | 14 | export type Link = z.infer<typeof LinkSchema>; |
| 15 | 15 | |
| 16 | 16 | export const TextSchema = z.object({ |
| 17 | 17 | "media_type": z.string(), |
| 18 | 18 | "title": z.string(), |
| 19 | 19 | "url": z.string(), |
| 20 | -}); | |
| 20 | +}).strict(); | |
| 21 | 21 | export type Text = z.infer<typeof TextSchema>; |
| 22 | 22 | |
| 23 | 23 | export const TopLevelElementSchema = z.object({ |
| @@ -29,7 +29,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 29 | 29 | "other_names": z.array(z.any()), |
| 30 | 30 | "superseded_by": z.null(), |
| 31 | 31 | "text": z.array(TextSchema), |
| 32 | -}); | |
| 32 | +}).strict(); | |
| 33 | 33 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 34 | 34 | |
| 35 | 35 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +3 −3test/inputs/json/misc/09f54.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -4,7 +4,7 @@ import * as z from "zod"; | ||
| 4 | 4 | export const DatumSchema = z.object({ |
| 5 | 5 | "anomaly": z.string(), |
| 6 | 6 | "value": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Datum = z.infer<typeof DatumSchema>; |
| 9 | 9 | |
| 10 | 10 | export const DescriptionSchema = z.object({ |
| @@ -12,11 +12,11 @@ export const DescriptionSchema = z.object({ | ||
| 12 | 12 | "missing": z.number().int(), |
| 13 | 13 | "title": z.string(), |
| 14 | 14 | "units": z.string(), |
| 15 | -}); | |
| 15 | +}).strict(); | |
| 16 | 16 | export type Description = z.infer<typeof DescriptionSchema>; |
| 17 | 17 | |
| 18 | 18 | export const TopLevelSchema = z.object({ |
| 19 | 19 | "data": z.record(z.string(), DatumSchema), |
| 20 | 20 | "description": DescriptionSchema, |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +3 −3test/inputs/json/misc/0a358.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -2,7 +2,7 @@ import * as z from "zod"; | ||
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | export const FacetsSchema = z.object({ |
| 5 | -}); | |
| 5 | +}).strict(); | |
| 6 | 6 | export type Facets = z.infer<typeof FacetsSchema>; |
| 7 | 7 | |
| 8 | 8 | export const ResultSchema = z.object({ |
| @@ -12,7 +12,7 @@ export const ResultSchema = z.object({ | ||
| 12 | 12 | "name": z.string(), |
| 13 | 13 | "updated_at": z.coerce.date(), |
| 14 | 14 | "uri": z.string(), |
| 15 | -}); | |
| 15 | +}).strict(); | |
| 16 | 16 | export type Result = z.infer<typeof ResultSchema>; |
| 17 | 17 | |
| 18 | 18 | export const TopLevelSchema = z.object({ |
| @@ -23,5 +23,5 @@ export const TopLevelSchema = z.object({ | ||
| 23 | 23 | "offset": z.number().int(), |
| 24 | 24 | "previous": z.boolean(), |
| 25 | 25 | "results": z.array(ResultSchema), |
| 26 | -}); | |
| 26 | +}).strict(); | |
| 27 | 27 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +12 −12test/inputs/json/misc/0a91a.json
Mtypescript-zoddefault / TopLevel.ts+12 −12
| @@ -17,13 +17,13 @@ export const ActorSchema = z.object({ | ||
| 17 | 17 | "id": z.number().int(), |
| 18 | 18 | "login": z.string(), |
| 19 | 19 | "url": z.string(), |
| 20 | -}); | |
| 20 | +}).strict(); | |
| 21 | 21 | export type Actor = z.infer<typeof ActorSchema>; |
| 22 | 22 | |
| 23 | 23 | export const AuthorSchema = z.object({ |
| 24 | 24 | "email": z.string(), |
| 25 | 25 | "name": z.string(), |
| 26 | -}); | |
| 26 | +}).strict(); | |
| 27 | 27 | export type Author = z.infer<typeof AuthorSchema>; |
| 28 | 28 | |
| 29 | 29 | export const MergedBySchema = z.object({ |
| @@ -44,19 +44,19 @@ export const MergedBySchema = z.object({ | ||
| 44 | 44 | "subscriptions_url": z.string(), |
| 45 | 45 | "type": z.string(), |
| 46 | 46 | "url": z.string(), |
| 47 | -}); | |
| 47 | +}).strict(); | |
| 48 | 48 | export type MergedBy = z.infer<typeof MergedBySchema>; |
| 49 | 49 | |
| 50 | 50 | export const CommentsSchema = z.object({ |
| 51 | 51 | "href": z.string(), |
| 52 | -}); | |
| 52 | +}).strict(); | |
| 53 | 53 | export type Comments = z.infer<typeof CommentsSchema>; |
| 54 | 54 | |
| 55 | 55 | export const TopLevelRepoSchema = z.object({ |
| 56 | 56 | "id": z.number().int(), |
| 57 | 57 | "name": z.string(), |
| 58 | 58 | "url": z.string(), |
| 59 | -}); | |
| 59 | +}).strict(); | |
| 60 | 60 | export type TopLevelRepo = z.infer<typeof TopLevelRepoSchema>; |
| 61 | 61 | |
| 62 | 62 | export const CommitSchema = z.object({ |
| @@ -65,7 +65,7 @@ export const CommitSchema = z.object({ | ||
| 65 | 65 | "message": z.string(), |
| 66 | 66 | "sha": z.string(), |
| 67 | 67 | "url": z.string(), |
| 68 | -}); | |
| 68 | +}).strict(); | |
| 69 | 69 | export type Commit = z.infer<typeof CommitSchema>; |
| 70 | 70 | |
| 71 | 71 | export const BaseRepoSchema = z.object({ |
| @@ -138,7 +138,7 @@ export const BaseRepoSchema = z.object({ | ||
| 138 | 138 | "url": z.string(), |
| 139 | 139 | "watchers": z.number().int(), |
| 140 | 140 | "watchers_count": z.number().int(), |
| 141 | -}); | |
| 141 | +}).strict(); | |
| 142 | 142 | export type BaseRepo = z.infer<typeof BaseRepoSchema>; |
| 143 | 143 | |
| 144 | 144 | export const LinksSchema = z.object({ |
| @@ -150,7 +150,7 @@ export const LinksSchema = z.object({ | ||
| 150 | 150 | "review_comments": CommentsSchema, |
| 151 | 151 | "self": CommentsSchema, |
| 152 | 152 | "statuses": CommentsSchema, |
| 153 | -}); | |
| 153 | +}).strict(); | |
| 154 | 154 | export type Links = z.infer<typeof LinksSchema>; |
| 155 | 155 | |
| 156 | 156 | export const BaseSchema = z.object({ |
| @@ -159,7 +159,7 @@ export const BaseSchema = z.object({ | ||
| 159 | 159 | "repo": BaseRepoSchema, |
| 160 | 160 | "sha": z.string(), |
| 161 | 161 | "user": MergedBySchema, |
| 162 | -}); | |
| 162 | +}).strict(); | |
| 163 | 163 | export type Base = z.infer<typeof BaseSchema>; |
| 164 | 164 | |
| 165 | 165 | export const PullRequestSchema = z.object({ |
| @@ -204,7 +204,7 @@ export const PullRequestSchema = z.object({ | ||
| 204 | 204 | "updated_at": z.coerce.date(), |
| 205 | 205 | "url": z.string(), |
| 206 | 206 | "user": MergedBySchema, |
| 207 | -}); | |
| 207 | +}).strict(); | |
| 208 | 208 | export type PullRequest = z.infer<typeof PullRequestSchema>; |
| 209 | 209 | |
| 210 | 210 | export const PayloadSchema = z.object({ |
| @@ -222,7 +222,7 @@ export const PayloadSchema = z.object({ | ||
| 222 | 222 | "ref": z.string().optional(), |
| 223 | 223 | "ref_type": z.string().optional(), |
| 224 | 224 | "size": z.number().int().optional(), |
| 225 | -}); | |
| 225 | +}).strict(); | |
| 226 | 226 | export type Payload = z.infer<typeof PayloadSchema>; |
| 227 | 227 | |
| 228 | 228 | export const TopLevelElementSchema = z.object({ |
| @@ -234,7 +234,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 234 | 234 | "public": z.boolean(), |
| 235 | 235 | "repo": TopLevelRepoSchema, |
| 236 | 236 | "type": TypeSchema, |
| 237 | -}); | |
| 237 | +}).strict(); | |
| 238 | 238 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 239 | 239 | |
| 240 | 240 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +6 −6test/inputs/json/misc/0b91a.json
Mtypescript-zoddefault / TopLevel.ts+6 −6
| @@ -4,27 +4,27 @@ import * as z from "zod"; | ||
| 4 | 4 | export const ResponseInfoSchema = z.object({ |
| 5 | 5 | "developerMessage": z.string(), |
| 6 | 6 | "status": z.number().int(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type ResponseInfo = z.infer<typeof ResponseInfoSchema>; |
| 9 | 9 | |
| 10 | 10 | export const ResultsetSchema = z.object({ |
| 11 | 11 | "count": z.number().int(), |
| 12 | 12 | "page": z.number().int(), |
| 13 | 13 | "pagesize": z.number().int(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Resultset = z.infer<typeof ResultsetSchema>; |
| 16 | 16 | |
| 17 | 17 | export const ComponentSchema = z.object({ |
| 18 | 18 | "name": z.string(), |
| 19 | 19 | "uuid": z.string().uuid(), |
| 20 | -}); | |
| 20 | +}).strict(); | |
| 21 | 21 | export type Component = z.infer<typeof ComponentSchema>; |
| 22 | 22 | |
| 23 | 23 | export const MetadataSchema = z.object({ |
| 24 | 24 | "executionTime": z.number(), |
| 25 | 25 | "responseInfo": ResponseInfoSchema, |
| 26 | 26 | "resultset": ResultsetSchema, |
| 27 | -}); | |
| 27 | +}).strict(); | |
| 28 | 28 | export type Metadata = z.infer<typeof MetadataSchema>; |
| 29 | 29 | |
| 30 | 30 | export const ResultSchema = z.object({ |
| @@ -42,11 +42,11 @@ export const ResultSchema = z.object({ | ||
| 42 | 42 | "url": z.string(), |
| 43 | 43 | "uuid": z.string().uuid(), |
| 44 | 44 | "vuuid": z.string().uuid(), |
| 45 | -}); | |
| 45 | +}).strict(); | |
| 46 | 46 | export type Result = z.infer<typeof ResultSchema>; |
| 47 | 47 | |
| 48 | 48 | export const TopLevelSchema = z.object({ |
| 49 | 49 | "metadata": MetadataSchema, |
| 50 | 50 | "results": z.array(ResultSchema), |
| 51 | -}); | |
| 51 | +}).strict(); | |
| 52 | 52 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +10 −10test/inputs/json/misc/0cffa.json
Mtypescript-zoddefault / TopLevel.ts+10 −10
| @@ -27,7 +27,7 @@ export const The480_WStillSchema = z.object({ | ||
| 27 | 27 | "size": z.string().regex(/^-?\d+$/).optional(), |
| 28 | 28 | "url": z.string(), |
| 29 | 29 | "width": z.string().regex(/^-?\d+$/), |
| 30 | -}); | |
| 30 | +}).strict(); | |
| 31 | 31 | export type The480_WStill = z.infer<typeof The480_WStillSchema>; |
| 32 | 32 | |
| 33 | 33 | export const DownsizedSmallSchema = z.object({ |
| @@ -35,7 +35,7 @@ export const DownsizedSmallSchema = z.object({ | ||
| 35 | 35 | "mp4": z.string(), |
| 36 | 36 | "mp4_size": z.string().regex(/^-?\d+$/), |
| 37 | 37 | "width": z.string().regex(/^-?\d+$/), |
| 38 | -}); | |
| 38 | +}).strict(); | |
| 39 | 39 | export type DownsizedSmall = z.infer<typeof DownsizedSmallSchema>; |
| 40 | 40 | |
| 41 | 41 | export const FixedHeightSchema = z.object({ |
| @@ -49,13 +49,13 @@ export const FixedHeightSchema = z.object({ | ||
| 49 | 49 | "webp": z.string(), |
| 50 | 50 | "webp_size": z.string().regex(/^-?\d+$/), |
| 51 | 51 | "width": z.string().regex(/^-?\d+$/), |
| 52 | -}); | |
| 52 | +}).strict(); | |
| 53 | 53 | export type FixedHeight = z.infer<typeof FixedHeightSchema>; |
| 54 | 54 | |
| 55 | 55 | export const LoopingSchema = z.object({ |
| 56 | 56 | "mp4": z.string(), |
| 57 | 57 | "mp4_size": z.string().regex(/^-?\d+$/), |
| 58 | -}); | |
| 58 | +}).strict(); | |
| 59 | 59 | export type Looping = z.infer<typeof LoopingSchema>; |
| 60 | 60 | |
| 61 | 61 | export const UserSchema = z.object({ |
| @@ -65,21 +65,21 @@ export const UserSchema = z.object({ | ||
| 65 | 65 | "profile_url": z.string(), |
| 66 | 66 | "twitter": z.string(), |
| 67 | 67 | "username": UsernameSchema, |
| 68 | -}); | |
| 68 | +}).strict(); | |
| 69 | 69 | export type User = z.infer<typeof UserSchema>; |
| 70 | 70 | |
| 71 | 71 | export const MetaSchema = z.object({ |
| 72 | 72 | "msg": z.string(), |
| 73 | 73 | "response_id": z.string(), |
| 74 | 74 | "status": z.number().int(), |
| 75 | -}); | |
| 75 | +}).strict(); | |
| 76 | 76 | export type Meta = z.infer<typeof MetaSchema>; |
| 77 | 77 | |
| 78 | 78 | export const PaginationSchema = z.object({ |
| 79 | 79 | "count": z.number().int(), |
| 80 | 80 | "offset": z.number().int(), |
| 81 | 81 | "total_count": z.number().int(), |
| 82 | -}); | |
| 82 | +}).strict(); | |
| 83 | 83 | export type Pagination = z.infer<typeof PaginationSchema>; |
| 84 | 84 | |
| 85 | 85 | export const ImagesSchema = z.object({ |
| @@ -106,7 +106,7 @@ export const ImagesSchema = z.object({ | ||
| 106 | 106 | "preview_gif": The480_WStillSchema, |
| 107 | 107 | "preview_webp": The480_WStillSchema, |
| 108 | 108 | "480w_still": The480_WStillSchema.optional(), |
| 109 | -}); | |
| 109 | +}).strict(); | |
| 110 | 110 | export type Images = z.infer<typeof ImagesSchema>; |
| 111 | 111 | |
| 112 | 112 | export const DatumSchema = z.object({ |
| @@ -128,12 +128,12 @@ export const DatumSchema = z.object({ | ||
| 128 | 128 | "url": z.string(), |
| 129 | 129 | "user": UserSchema.optional(), |
| 130 | 130 | "username": UsernameSchema, |
| 131 | -}); | |
| 131 | +}).strict(); | |
| 132 | 132 | export type Datum = z.infer<typeof DatumSchema>; |
| 133 | 133 | |
| 134 | 134 | export const TopLevelSchema = z.object({ |
| 135 | 135 | "data": z.array(DatumSchema), |
| 136 | 136 | "meta": MetaSchema, |
| 137 | 137 | "pagination": PaginationSchema, |
| 138 | -}); | |
| 138 | +}).strict(); | |
| 139 | 139 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +8 −8test/inputs/json/misc/0e0c2.json
Mtypescript-zoddefault / TopLevel.ts+8 −8
| @@ -26,7 +26,7 @@ export const CollectionSchema = z.object({ | ||
| 26 | 26 | "movies": z.array(z.number().int()), |
| 27 | 27 | "name": z.string(), |
| 28 | 28 | "slug": z.string(), |
| 29 | -}); | |
| 29 | +}).strict(); | |
| 30 | 30 | export type Collection = z.infer<typeof CollectionSchema>; |
| 31 | 31 | |
| 32 | 32 | export const DetailSchema = z.object({ |
| @@ -37,14 +37,14 @@ export const DetailSchema = z.object({ | ||
| 37 | 37 | "storyline": z.string(), |
| 38 | 38 | "tagline": z.string(), |
| 39 | 39 | "title": z.string(), |
| 40 | -}); | |
| 40 | +}).strict(); | |
| 41 | 41 | export type Detail = z.infer<typeof DetailSchema>; |
| 42 | 42 | |
| 43 | 43 | export const FavMovieSchema = z.object({ |
| 44 | 44 | "follow": z.boolean(), |
| 45 | 45 | "star": z.boolean(), |
| 46 | 46 | "watched": z.boolean(), |
| 47 | -}); | |
| 47 | +}).strict(); | |
| 48 | 48 | export type FavMovie = z.infer<typeof FavMovieSchema>; |
| 49 | 49 | |
| 50 | 50 | export const ImageSchema = z.object({ |
| @@ -53,7 +53,7 @@ export const ImageSchema = z.object({ | ||
| 53 | 53 | "thumbnail": z.string(), |
| 54 | 54 | "type": TypeSchema, |
| 55 | 55 | "url": z.string(), |
| 56 | -}); | |
| 56 | +}).strict(); | |
| 57 | 57 | export type Image = z.infer<typeof ImageSchema>; |
| 58 | 58 | |
| 59 | 59 | export const VideoSchema = z.object({ |
| @@ -61,14 +61,14 @@ export const VideoSchema = z.object({ | ||
| 61 | 61 | "language": ResultLanguageSchema, |
| 62 | 62 | "source": z.string(), |
| 63 | 63 | "url": z.string(), |
| 64 | -}); | |
| 64 | +}).strict(); | |
| 65 | 65 | export type Video = z.infer<typeof VideoSchema>; |
| 66 | 66 | |
| 67 | 67 | export const VoteScoreSchema = z.object({ |
| 68 | 68 | "avg": z.number().int(), |
| 69 | 69 | "score": z.number().int(), |
| 70 | 70 | "total": z.number().int(), |
| 71 | -}); | |
| 71 | +}).strict(); | |
| 72 | 72 | export type VoteScore = z.infer<typeof VoteScoreSchema>; |
| 73 | 73 | |
| 74 | 74 | export const ResultSchema = z.object({ |
| @@ -87,7 +87,7 @@ export const ResultSchema = z.object({ | ||
| 87 | 87 | "videos": z.array(VideoSchema), |
| 88 | 88 | "vote_score": VoteScoreSchema, |
| 89 | 89 | "watches": z.number().int(), |
| 90 | -}); | |
| 90 | +}).strict(); | |
| 91 | 91 | export type Result = z.infer<typeof ResultSchema>; |
| 92 | 92 | |
| 93 | 93 | export const TopLevelSchema = z.object({ |
| @@ -95,5 +95,5 @@ export const TopLevelSchema = z.object({ | ||
| 95 | 95 | "next": z.string(), |
| 96 | 96 | "previous": z.null(), |
| 97 | 97 | "results": z.array(ResultSchema), |
| 98 | -}); | |
| 98 | +}).strict(); | |
| 99 | 99 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/0fecf.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -3,5 +3,5 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "countries": z.array(z.string()), |
| 6 | -}); | |
| 6 | +}).strict(); | |
| 7 | 7 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +5 −5test/inputs/json/misc/10be4.json
Mtypescript-zoddefault / TopLevel.ts+5 −5
| @@ -55,26 +55,26 @@ export type Title = z.infer<typeof TitleSchema>; | ||
| 55 | 55 | export const IdentifierSchema = z.object({ |
| 56 | 56 | "identifier": z.string(), |
| 57 | 57 | "scheme": SchemeSchema, |
| 58 | -}); | |
| 58 | +}).strict(); | |
| 59 | 59 | export type Identifier = z.infer<typeof IdentifierSchema>; |
| 60 | 60 | |
| 61 | 61 | export const LinkSchema = z.object({ |
| 62 | 62 | "note": NoteSchema, |
| 63 | 63 | "url": z.string(), |
| 64 | -}); | |
| 64 | +}).strict(); | |
| 65 | 65 | export type Link = z.infer<typeof LinkSchema>; |
| 66 | 66 | |
| 67 | 67 | export const OtherNameSchema = z.object({ |
| 68 | 68 | "name": z.string(), |
| 69 | 69 | "note": z.union([z.null(), z.string()]), |
| 70 | -}); | |
| 70 | +}).strict(); | |
| 71 | 71 | export type OtherName = z.infer<typeof OtherNameSchema>; |
| 72 | 72 | |
| 73 | 73 | export const TextSchema = z.object({ |
| 74 | 74 | "media_type": MediaTypeSchema, |
| 75 | 75 | "title": TitleSchema, |
| 76 | 76 | "url": z.string(), |
| 77 | -}); | |
| 77 | +}).strict(); | |
| 78 | 78 | export type Text = z.infer<typeof TextSchema>; |
| 79 | 79 | |
| 80 | 80 | export const TopLevelElementSchema = z.object({ |
| @@ -86,7 +86,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 86 | 86 | "other_names": z.array(OtherNameSchema), |
| 87 | 87 | "superseded_by": z.union([z.null(), z.string()]), |
| 88 | 88 | "text": z.array(TextSchema), |
| 89 | -}); | |
| 89 | +}).strict(); | |
| 90 | 90 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 91 | 91 | |
| 92 | 92 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +3 −3test/inputs/json/misc/112b5.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -2,7 +2,7 @@ import * as z from "zod"; | ||
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | export const ArgsSchema = z.object({ |
| 5 | -}); | |
| 5 | +}).strict(); | |
| 6 | 6 | export type Args = z.infer<typeof ArgsSchema>; |
| 7 | 7 | |
| 8 | 8 | export const HeadersSchema = z.object({ |
| @@ -10,7 +10,7 @@ export const HeadersSchema = z.object({ | ||
| 10 | 10 | "Connection": z.string(), |
| 11 | 11 | "Host": z.string(), |
| 12 | 12 | "User-Agent": z.string(), |
| 13 | -}); | |
| 13 | +}).strict(); | |
| 14 | 14 | export type Headers = z.infer<typeof HeadersSchema>; |
| 15 | 15 | |
| 16 | 16 | export const TopLevelSchema = z.object({ |
| @@ -18,5 +18,5 @@ export const TopLevelSchema = z.object({ | ||
| 18 | 18 | "headers": HeadersSchema, |
| 19 | 19 | "origin": z.string(), |
| 20 | 20 | "url": z.string(), |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +10 −10test/inputs/json/misc/127a1.json
Mtypescript-zoddefault / TopLevel.ts+10 −10
| @@ -26,7 +26,7 @@ export const The480_WStillSchema = z.object({ | ||
| 26 | 26 | "size": z.string().regex(/^-?\d+$/).optional(), |
| 27 | 27 | "url": z.string(), |
| 28 | 28 | "width": z.string().regex(/^-?\d+$/), |
| 29 | -}); | |
| 29 | +}).strict(); | |
| 30 | 30 | export type The480_WStill = z.infer<typeof The480_WStillSchema>; |
| 31 | 31 | |
| 32 | 32 | export const DownsizedSmallSchema = z.object({ |
| @@ -34,7 +34,7 @@ export const DownsizedSmallSchema = z.object({ | ||
| 34 | 34 | "mp4": z.string(), |
| 35 | 35 | "mp4_size": z.string().regex(/^-?\d+$/), |
| 36 | 36 | "width": z.string().regex(/^-?\d+$/), |
| 37 | -}); | |
| 37 | +}).strict(); | |
| 38 | 38 | export type DownsizedSmall = z.infer<typeof DownsizedSmallSchema>; |
| 39 | 39 | |
| 40 | 40 | export const FixedHeightSchema = z.object({ |
| @@ -48,13 +48,13 @@ export const FixedHeightSchema = z.object({ | ||
| 48 | 48 | "webp": z.string(), |
| 49 | 49 | "webp_size": z.string().regex(/^-?\d+$/), |
| 50 | 50 | "width": z.string().regex(/^-?\d+$/), |
| 51 | -}); | |
| 51 | +}).strict(); | |
| 52 | 52 | export type FixedHeight = z.infer<typeof FixedHeightSchema>; |
| 53 | 53 | |
| 54 | 54 | export const LoopingSchema = z.object({ |
| 55 | 55 | "mp4": z.string(), |
| 56 | 56 | "mp4_size": z.string().regex(/^-?\d+$/), |
| 57 | -}); | |
| 57 | +}).strict(); | |
| 58 | 58 | export type Looping = z.infer<typeof LoopingSchema>; |
| 59 | 59 | |
| 60 | 60 | export const UserSchema = z.object({ |
| @@ -64,21 +64,21 @@ export const UserSchema = z.object({ | ||
| 64 | 64 | "profile_url": z.string(), |
| 65 | 65 | "twitter": z.string().optional(), |
| 66 | 66 | "username": UsernameSchema, |
| 67 | -}); | |
| 67 | +}).strict(); | |
| 68 | 68 | export type User = z.infer<typeof UserSchema>; |
| 69 | 69 | |
| 70 | 70 | export const MetaSchema = z.object({ |
| 71 | 71 | "msg": z.string(), |
| 72 | 72 | "response_id": z.string(), |
| 73 | 73 | "status": z.number().int(), |
| 74 | -}); | |
| 74 | +}).strict(); | |
| 75 | 75 | export type Meta = z.infer<typeof MetaSchema>; |
| 76 | 76 | |
| 77 | 77 | export const PaginationSchema = z.object({ |
| 78 | 78 | "count": z.number().int(), |
| 79 | 79 | "offset": z.number().int(), |
| 80 | 80 | "total_count": z.number().int(), |
| 81 | -}); | |
| 81 | +}).strict(); | |
| 82 | 82 | export type Pagination = z.infer<typeof PaginationSchema>; |
| 83 | 83 | |
| 84 | 84 | export const ImagesSchema = z.object({ |
| @@ -105,7 +105,7 @@ export const ImagesSchema = z.object({ | ||
| 105 | 105 | "preview_gif": The480_WStillSchema, |
| 106 | 106 | "preview_webp": The480_WStillSchema, |
| 107 | 107 | "480w_still": The480_WStillSchema.optional(), |
| 108 | -}); | |
| 108 | +}).strict(); | |
| 109 | 109 | export type Images = z.infer<typeof ImagesSchema>; |
| 110 | 110 | |
| 111 | 111 | export const DatumSchema = z.object({ |
| @@ -127,12 +127,12 @@ export const DatumSchema = z.object({ | ||
| 127 | 127 | "url": z.string(), |
| 128 | 128 | "user": UserSchema.optional(), |
| 129 | 129 | "username": UsernameSchema, |
| 130 | -}); | |
| 130 | +}).strict(); | |
| 131 | 131 | export type Datum = z.infer<typeof DatumSchema>; |
| 132 | 132 | |
| 133 | 133 | export const TopLevelSchema = z.object({ |
| 134 | 134 | "data": z.array(DatumSchema), |
| 135 | 135 | "meta": MetaSchema, |
| 136 | 136 | "pagination": PaginationSchema, |
| 137 | -}); | |
| 137 | +}).strict(); | |
| 138 | 138 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/misc/13d8d.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -4,20 +4,20 @@ import * as z from "zod"; | ||
| 4 | 4 | export const StreetSchema = z.object({ |
| 5 | 5 | "id": z.number().int(), |
| 6 | 6 | "name": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Street = z.infer<typeof StreetSchema>; |
| 9 | 9 | |
| 10 | 10 | export const OutcomeStatusSchema = z.object({ |
| 11 | 11 | "category": z.string(), |
| 12 | 12 | "date": z.string(), |
| 13 | -}); | |
| 13 | +}).strict(); | |
| 14 | 14 | export type OutcomeStatus = z.infer<typeof OutcomeStatusSchema>; |
| 15 | 15 | |
| 16 | 16 | export const LocationSchema = z.object({ |
| 17 | 17 | "latitude": z.string(), |
| 18 | 18 | "longitude": z.string(), |
| 19 | 19 | "street": StreetSchema, |
| 20 | -}); | |
| 20 | +}).strict(); | |
| 21 | 21 | export type Location = z.infer<typeof LocationSchema>; |
| 22 | 22 | |
| 23 | 23 | export const TopLevelElementSchema = z.object({ |
| @@ -30,7 +30,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 30 | 30 | "month": z.string(), |
| 31 | 31 | "outcome_status": OutcomeStatusSchema, |
| 32 | 32 | "persistent_id": z.string(), |
| 33 | -}); | |
| 33 | +}).strict(); | |
| 34 | 34 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 35 | 35 | |
| 36 | 36 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +2 −2test/inputs/json/misc/14d38.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -6,10 +6,10 @@ export const HeadersSchema = z.object({ | ||
| 6 | 6 | "Connection": z.string(), |
| 7 | 7 | "Host": z.string(), |
| 8 | 8 | "User-Agent": z.string(), |
| 9 | -}); | |
| 9 | +}).strict(); | |
| 10 | 10 | export type Headers = z.infer<typeof HeadersSchema>; |
| 11 | 11 | |
| 12 | 12 | export const TopLevelSchema = z.object({ |
| 13 | 13 | "headers": HeadersSchema, |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/167d6.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -5,5 +5,5 @@ export const TopLevelSchema = z.object({ | ||
| 5 | 5 | "base": z.string(), |
| 6 | 6 | "date": z.string(), |
| 7 | 7 | "rates": z.record(z.string(), z.number()), |
| 8 | -}); | |
| 8 | +}).strict(); | |
| 9 | 9 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +14 −14test/inputs/json/misc/16bc5.json
Mtypescript-zoddefault / TopLevel.ts+14 −14
| @@ -4,7 +4,7 @@ import * as z from "zod"; | ||
| 4 | 4 | export const AstronomySchema = z.object({ |
| 5 | 5 | "sunrise": z.string(), |
| 6 | 6 | "sunset": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Astronomy = z.infer<typeof AstronomySchema>; |
| 9 | 9 | |
| 10 | 10 | export const AtmosphereSchema = z.object({ |
| @@ -12,7 +12,7 @@ export const AtmosphereSchema = z.object({ | ||
| 12 | 12 | "pressure": z.string(), |
| 13 | 13 | "rising": z.string().regex(/^-?\d+$/), |
| 14 | 14 | "visibility": z.string(), |
| 15 | -}); | |
| 15 | +}).strict(); | |
| 16 | 16 | export type Atmosphere = z.infer<typeof AtmosphereSchema>; |
| 17 | 17 | |
| 18 | 18 | export const ImageSchema = z.object({ |
| @@ -21,7 +21,7 @@ export const ImageSchema = z.object({ | ||
| 21 | 21 | "title": z.string(), |
| 22 | 22 | "url": z.string(), |
| 23 | 23 | "width": z.string().regex(/^-?\d+$/), |
| 24 | -}); | |
| 24 | +}).strict(); | |
| 25 | 25 | export type Image = z.infer<typeof ImageSchema>; |
| 26 | 26 | |
| 27 | 27 | export const ConditionSchema = z.object({ |
| @@ -29,7 +29,7 @@ export const ConditionSchema = z.object({ | ||
| 29 | 29 | "date": z.string(), |
| 30 | 30 | "temp": z.string().regex(/^-?\d+$/), |
| 31 | 31 | "text": z.string(), |
| 32 | -}); | |
| 32 | +}).strict(); | |
| 33 | 33 | export type Condition = z.infer<typeof ConditionSchema>; |
| 34 | 34 | |
| 35 | 35 | export const ForecastSchema = z.object({ |
| @@ -39,19 +39,19 @@ export const ForecastSchema = z.object({ | ||
| 39 | 39 | "high": z.string().regex(/^-?\d+$/), |
| 40 | 40 | "low": z.string().regex(/^-?\d+$/), |
| 41 | 41 | "text": z.string(), |
| 42 | -}); | |
| 42 | +}).strict(); | |
| 43 | 43 | export type Forecast = z.infer<typeof ForecastSchema>; |
| 44 | 44 | |
| 45 | 45 | export const GuidSchema = z.object({ |
| 46 | 46 | "isPermaLink": z.enum(["true", "false"]), |
| 47 | -}); | |
| 47 | +}).strict(); | |
| 48 | 48 | export type Guid = z.infer<typeof GuidSchema>; |
| 49 | 49 | |
| 50 | 50 | export const LocationSchema = z.object({ |
| 51 | 51 | "city": z.string(), |
| 52 | 52 | "country": z.string(), |
| 53 | 53 | "region": z.string(), |
| 54 | -}); | |
| 54 | +}).strict(); | |
| 55 | 55 | export type Location = z.infer<typeof LocationSchema>; |
| 56 | 56 | |
| 57 | 57 | export const UnitsSchema = z.object({ |
| @@ -59,14 +59,14 @@ export const UnitsSchema = z.object({ | ||
| 59 | 59 | "pressure": z.string(), |
| 60 | 60 | "speed": z.string(), |
| 61 | 61 | "temperature": z.string(), |
| 62 | -}); | |
| 62 | +}).strict(); | |
| 63 | 63 | export type Units = z.infer<typeof UnitsSchema>; |
| 64 | 64 | |
| 65 | 65 | export const WindSchema = z.object({ |
| 66 | 66 | "chill": z.string().regex(/^-?\d+$/), |
| 67 | 67 | "direction": z.string().regex(/^-?\d+$/), |
| 68 | 68 | "speed": z.string().regex(/^-?\d+$/), |
| 69 | -}); | |
| 69 | +}).strict(); | |
| 70 | 70 | export type Wind = z.infer<typeof WindSchema>; |
| 71 | 71 | |
| 72 | 72 | export const ItemSchema = z.object({ |
| @@ -79,7 +79,7 @@ export const ItemSchema = z.object({ | ||
| 79 | 79 | "long": z.string(), |
| 80 | 80 | "pubDate": z.string(), |
| 81 | 81 | "title": z.string(), |
| 82 | -}); | |
| 82 | +}).strict(); | |
| 83 | 83 | export type Item = z.infer<typeof ItemSchema>; |
| 84 | 84 | |
| 85 | 85 | export const ChannelSchema = z.object({ |
| @@ -96,12 +96,12 @@ export const ChannelSchema = z.object({ | ||
| 96 | 96 | "ttl": z.string().regex(/^-?\d+$/), |
| 97 | 97 | "units": UnitsSchema, |
| 98 | 98 | "wind": WindSchema, |
| 99 | -}); | |
| 99 | +}).strict(); | |
| 100 | 100 | export type Channel = z.infer<typeof ChannelSchema>; |
| 101 | 101 | |
| 102 | 102 | export const ResultsSchema = z.object({ |
| 103 | 103 | "channel": ChannelSchema, |
| 104 | -}); | |
| 104 | +}).strict(); | |
| 105 | 105 | export type Results = z.infer<typeof ResultsSchema>; |
| 106 | 106 | |
| 107 | 107 | export const QuerySchema = z.object({ |
| @@ -109,10 +109,10 @@ export const QuerySchema = z.object({ | ||
| 109 | 109 | "created": z.coerce.date(), |
| 110 | 110 | "lang": z.string(), |
| 111 | 111 | "results": ResultsSchema, |
| 112 | -}); | |
| 112 | +}).strict(); | |
| 113 | 113 | export type Query = z.infer<typeof QuerySchema>; |
| 114 | 114 | |
| 115 | 115 | export const TopLevelSchema = z.object({ |
| 116 | 116 | "query": QuerySchema, |
| 117 | -}); | |
| 117 | +}).strict(); | |
| 118 | 118 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +5 −5test/inputs/json/misc/176f1.json
Mtypescript-zoddefault / TopLevel.ts+5 −5
| @@ -4,7 +4,7 @@ import * as z from "zod"; | ||
| 4 | 4 | export const FootnoteSchema = z.object({ |
| 5 | 5 | "code": z.string().optional(), |
| 6 | 6 | "text": z.string().optional(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Footnote = z.infer<typeof FootnoteSchema>; |
| 9 | 9 | |
| 10 | 10 | export const DatumSchema = z.object({ |
| @@ -13,18 +13,18 @@ export const DatumSchema = z.object({ | ||
| 13 | 13 | "periodName": z.string(), |
| 14 | 14 | "value": z.string(), |
| 15 | 15 | "year": z.string().regex(/^-?\d+$/), |
| 16 | -}); | |
| 16 | +}).strict(); | |
| 17 | 17 | export type Datum = z.infer<typeof DatumSchema>; |
| 18 | 18 | |
| 19 | 19 | export const SeriesSchema = z.object({ |
| 20 | 20 | "data": z.array(DatumSchema), |
| 21 | 21 | "seriesID": z.string(), |
| 22 | -}); | |
| 22 | +}).strict(); | |
| 23 | 23 | export type Series = z.infer<typeof SeriesSchema>; |
| 24 | 24 | |
| 25 | 25 | export const ResultsSchema = z.object({ |
| 26 | 26 | "series": z.array(SeriesSchema), |
| 27 | -}); | |
| 27 | +}).strict(); | |
| 28 | 28 | export type Results = z.infer<typeof ResultsSchema>; |
| 29 | 29 | |
| 30 | 30 | export const TopLevelSchema = z.object({ |
| @@ -32,5 +32,5 @@ export const TopLevelSchema = z.object({ | ||
| 32 | 32 | "responseTime": z.number().int(), |
| 33 | 33 | "Results": ResultsSchema, |
| 34 | 34 | "status": z.string(), |
| 35 | -}); | |
| 35 | +}).strict(); | |
| 36 | 36 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/1a7f5.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -13,7 +13,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 13 | 13 | "males": z.number().int(), |
| 14 | 14 | "total": z.number().int(), |
| 15 | 15 | "year": z.number().int(), |
| 16 | -}); | |
| 16 | +}).strict(); | |
| 17 | 17 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 18 | 18 | |
| 19 | 19 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +2 −2test/inputs/json/misc/1b28c.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -4,10 +4,10 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TotalPopulationSchema = z.object({ |
| 5 | 5 | "date": z.string(), |
| 6 | 6 | "population": z.number().int(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type TotalPopulation = z.infer<typeof TotalPopulationSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "total_population": z.array(TotalPopulationSchema), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +5 −5test/inputs/json/misc/1b409.json
Mtypescript-zoddefault / TopLevel.ts+5 −5
| @@ -56,7 +56,7 @@ export const MetaSchema = z.object({ | ||
| 56 | 56 | "limit": z.number().int(), |
| 57 | 57 | "offset": z.number().int(), |
| 58 | 58 | "total_count": z.number().int(), |
| 59 | -}); | |
| 59 | +}).strict(); | |
| 60 | 60 | export type Meta = z.infer<typeof MetaSchema>; |
| 61 | 61 | |
| 62 | 62 | export const ExtraSchema = z.object({ |
| @@ -65,7 +65,7 @@ export const ExtraSchema = z.object({ | ||
| 65 | 65 | "fax": z.union([z.null(), z.string()]).optional(), |
| 66 | 66 | "office": z.string(), |
| 67 | 67 | "rss_url": z.string().optional(), |
| 68 | -}); | |
| 68 | +}).strict(); | |
| 69 | 69 | export type Extra = z.infer<typeof ExtraSchema>; |
| 70 | 70 | |
| 71 | 71 | export const PersonSchema = z.object({ |
| @@ -87,7 +87,7 @@ export const PersonSchema = z.object({ | ||
| 87 | 87 | "sortname": z.string(), |
| 88 | 88 | "twitterid": z.union([z.null(), z.string()]), |
| 89 | 89 | "youtubeid": z.union([z.null(), z.string()]), |
| 90 | -}); | |
| 90 | +}).strict(); | |
| 91 | 91 | export type Person = z.infer<typeof PersonSchema>; |
| 92 | 92 | |
| 93 | 93 | export const ObjectElementSchema = z.object({ |
| @@ -112,11 +112,11 @@ export const ObjectElementSchema = z.object({ | ||
| 112 | 112 | "title": TitleSchema, |
| 113 | 113 | "title_long": RoleTypeLabelSchema, |
| 114 | 114 | "website": z.string(), |
| 115 | -}); | |
| 115 | +}).strict(); | |
| 116 | 116 | export type ObjectElement = z.infer<typeof ObjectElementSchema>; |
| 117 | 117 | |
| 118 | 118 | export const TopLevelSchema = z.object({ |
| 119 | 119 | "meta": MetaSchema, |
| 120 | 120 | "objects": z.array(ObjectElementSchema), |
| 121 | -}); | |
| 121 | +}).strict(); | |
| 122 | 122 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +13 −13test/inputs/json/misc/2465e.json
Mtypescript-zoddefault / TopLevel.ts+13 −13
| @@ -4,14 +4,14 @@ import * as z from "zod"; | ||
| 4 | 4 | export const AnnotationsSchema = z.object({ |
| 5 | 5 | "description": z.string(), |
| 6 | 6 | "type": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Annotations = z.infer<typeof AnnotationsSchema>; |
| 9 | 9 | |
| 10 | 10 | export const InfoSchema = z.object({ |
| 11 | 11 | "description": z.string(), |
| 12 | 12 | "title": z.string(), |
| 13 | 13 | "version": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Info = z.infer<typeof InfoSchema>; |
| 16 | 16 | |
| 17 | 17 | export const ParameterSchema = z.object({ |
| @@ -21,12 +21,12 @@ export const ParameterSchema = z.object({ | ||
| 21 | 21 | "name": z.string(), |
| 22 | 22 | "required": z.boolean(), |
| 23 | 23 | "type": z.string(), |
| 24 | -}); | |
| 24 | +}).strict(); | |
| 25 | 25 | export type Parameter = z.infer<typeof ParameterSchema>; |
| 26 | 26 | |
| 27 | 27 | export const SchemaSchema = z.object({ |
| 28 | 28 | "$ref": z.string(), |
| 29 | -}); | |
| 29 | +}).strict(); | |
| 30 | 30 | export type Schema = z.infer<typeof SchemaSchema>; |
| 31 | 31 | |
| 32 | 32 | export const PropertiesSchema = z.object({ |
| @@ -36,28 +36,28 @@ export const PropertiesSchema = z.object({ | ||
| 36 | 36 | "label": AnnotationsSchema, |
| 37 | 37 | "sub_class_of": AnnotationsSchema, |
| 38 | 38 | "type": AnnotationsSchema, |
| 39 | -}); | |
| 39 | +}).strict(); | |
| 40 | 40 | export type Properties = z.infer<typeof PropertiesSchema>; |
| 41 | 41 | |
| 42 | 42 | export const The200Schema = z.object({ |
| 43 | 43 | "description": z.string(), |
| 44 | 44 | "schema": SchemaSchema, |
| 45 | -}); | |
| 45 | +}).strict(); | |
| 46 | 46 | export type The200 = z.infer<typeof The200Schema>; |
| 47 | 47 | |
| 48 | 48 | export const TaxonomySchema = z.object({ |
| 49 | 49 | "properties": PropertiesSchema, |
| 50 | -}); | |
| 50 | +}).strict(); | |
| 51 | 51 | export type Taxonomy = z.infer<typeof TaxonomySchema>; |
| 52 | 52 | |
| 53 | 53 | export const ResponsesSchema = z.object({ |
| 54 | 54 | "200": The200Schema, |
| 55 | -}); | |
| 55 | +}).strict(); | |
| 56 | 56 | export type Responses = z.infer<typeof ResponsesSchema>; |
| 57 | 57 | |
| 58 | 58 | export const DefinitionsSchema = z.object({ |
| 59 | 59 | "Taxonomy": TaxonomySchema, |
| 60 | -}); | |
| 60 | +}).strict(); | |
| 61 | 61 | export type Definitions = z.infer<typeof DefinitionsSchema>; |
| 62 | 62 | |
| 63 | 63 | export const GetSchema = z.object({ |
| @@ -66,17 +66,17 @@ export const GetSchema = z.object({ | ||
| 66 | 66 | "responses": ResponsesSchema, |
| 67 | 67 | "summary": z.string(), |
| 68 | 68 | "tags": z.array(z.string()), |
| 69 | -}); | |
| 69 | +}).strict(); | |
| 70 | 70 | export type Get = z.infer<typeof GetSchema>; |
| 71 | 71 | |
| 72 | 72 | export const ItaTaxonomiesSearchSchema = z.object({ |
| 73 | 73 | "get": GetSchema, |
| 74 | -}); | |
| 74 | +}).strict(); | |
| 75 | 75 | export type ItaTaxonomiesSearch = z.infer<typeof ItaTaxonomiesSearchSchema>; |
| 76 | 76 | |
| 77 | 77 | export const PathsSchema = z.object({ |
| 78 | 78 | "/ita_taxonomies/search": ItaTaxonomiesSearchSchema, |
| 79 | -}); | |
| 79 | +}).strict(); | |
| 80 | 80 | export type Paths = z.infer<typeof PathsSchema>; |
| 81 | 81 | |
| 82 | 82 | export const TopLevelSchema = z.object({ |
| @@ -88,5 +88,5 @@ export const TopLevelSchema = z.object({ | ||
| 88 | 88 | "produces": z.array(z.string()), |
| 89 | 89 | "schemes": z.array(z.string()), |
| 90 | 90 | "swagger": z.string(), |
| 91 | -}); | |
| 91 | +}).strict(); | |
| 92 | 92 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/misc/24f52.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -11,14 +11,14 @@ export const StatusSchema = z.object({ | ||
| 11 | 11 | "reason": z.string(), |
| 12 | 12 | "trend": z.string(), |
| 13 | 13 | "type": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Status = z.infer<typeof StatusSchema>; |
| 16 | 16 | |
| 17 | 17 | export const MetaSchema = z.object({ |
| 18 | 18 | "credit": z.string(), |
| 19 | 19 | "updated": z.string(), |
| 20 | 20 | "url": z.string(), |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type Meta = z.infer<typeof MetaSchema>; |
| 23 | 23 | |
| 24 | 24 | export const WeatherSchema = z.object({ |
| @@ -27,7 +27,7 @@ export const WeatherSchema = z.object({ | ||
| 27 | 27 | "visibility": z.number(), |
| 28 | 28 | "weather": z.string(), |
| 29 | 29 | "wind": z.string(), |
| 30 | -}); | |
| 30 | +}).strict(); | |
| 31 | 31 | export type Weather = z.infer<typeof WeatherSchema>; |
| 32 | 32 | |
| 33 | 33 | export const TopLevelSchema = z.object({ |
| @@ -39,5 +39,5 @@ export const TopLevelSchema = z.object({ | ||
| 39 | 39 | "state": z.string(), |
| 40 | 40 | "status": StatusSchema, |
| 41 | 41 | "weather": WeatherSchema, |
| 42 | -}); | |
| 42 | +}).strict(); | |
| 43 | 43 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +14 −14test/inputs/json/misc/262f0.json
Mtypescript-zoddefault / TopLevel.ts+14 −14
| @@ -11,7 +11,7 @@ export type Text = z.infer<typeof TextSchema>; | ||
| 11 | 11 | export const AstronomySchema = z.object({ |
| 12 | 12 | "sunrise": z.string(), |
| 13 | 13 | "sunset": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Astronomy = z.infer<typeof AstronomySchema>; |
| 16 | 16 | |
| 17 | 17 | export const AtmosphereSchema = z.object({ |
| @@ -19,7 +19,7 @@ export const AtmosphereSchema = z.object({ | ||
| 19 | 19 | "pressure": z.string(), |
| 20 | 20 | "rising": z.string().regex(/^-?\d+$/), |
| 21 | 21 | "visibility": z.string(), |
| 22 | -}); | |
| 22 | +}).strict(); | |
| 23 | 23 | export type Atmosphere = z.infer<typeof AtmosphereSchema>; |
| 24 | 24 | |
| 25 | 25 | export const ImageSchema = z.object({ |
| @@ -28,7 +28,7 @@ export const ImageSchema = z.object({ | ||
| 28 | 28 | "title": z.string(), |
| 29 | 29 | "url": z.string(), |
| 30 | 30 | "width": z.string().regex(/^-?\d+$/), |
| 31 | -}); | |
| 31 | +}).strict(); | |
| 32 | 32 | export type Image = z.infer<typeof ImageSchema>; |
| 33 | 33 | |
| 34 | 34 | export const ConditionSchema = z.object({ |
| @@ -36,7 +36,7 @@ export const ConditionSchema = z.object({ | ||
| 36 | 36 | "date": z.string(), |
| 37 | 37 | "temp": z.string().regex(/^-?\d+$/), |
| 38 | 38 | "text": TextSchema, |
| 39 | -}); | |
| 39 | +}).strict(); | |
| 40 | 40 | export type Condition = z.infer<typeof ConditionSchema>; |
| 41 | 41 | |
| 42 | 42 | export const ForecastSchema = z.object({ |
| @@ -46,19 +46,19 @@ export const ForecastSchema = z.object({ | ||
| 46 | 46 | "high": z.string().regex(/^-?\d+$/), |
| 47 | 47 | "low": z.string().regex(/^-?\d+$/), |
| 48 | 48 | "text": TextSchema, |
| 49 | -}); | |
| 49 | +}).strict(); | |
| 50 | 50 | export type Forecast = z.infer<typeof ForecastSchema>; |
| 51 | 51 | |
| 52 | 52 | export const GuidSchema = z.object({ |
| 53 | 53 | "isPermaLink": z.enum(["true", "false"]), |
| 54 | -}); | |
| 54 | +}).strict(); | |
| 55 | 55 | export type Guid = z.infer<typeof GuidSchema>; |
| 56 | 56 | |
| 57 | 57 | export const LocationSchema = z.object({ |
| 58 | 58 | "city": z.string(), |
| 59 | 59 | "country": z.string(), |
| 60 | 60 | "region": z.string(), |
| 61 | -}); | |
| 61 | +}).strict(); | |
| 62 | 62 | export type Location = z.infer<typeof LocationSchema>; |
| 63 | 63 | |
| 64 | 64 | export const UnitsSchema = z.object({ |
| @@ -66,14 +66,14 @@ export const UnitsSchema = z.object({ | ||
| 66 | 66 | "pressure": z.string(), |
| 67 | 67 | "speed": z.string(), |
| 68 | 68 | "temperature": z.string(), |
| 69 | -}); | |
| 69 | +}).strict(); | |
| 70 | 70 | export type Units = z.infer<typeof UnitsSchema>; |
| 71 | 71 | |
| 72 | 72 | export const WindSchema = z.object({ |
| 73 | 73 | "chill": z.string().regex(/^-?\d+$/), |
| 74 | 74 | "direction": z.string().regex(/^-?\d+$/), |
| 75 | 75 | "speed": z.string().regex(/^-?\d+$/), |
| 76 | -}); | |
| 76 | +}).strict(); | |
| 77 | 77 | export type Wind = z.infer<typeof WindSchema>; |
| 78 | 78 | |
| 79 | 79 | export const ItemSchema = z.object({ |
| @@ -86,7 +86,7 @@ export const ItemSchema = z.object({ | ||
| 86 | 86 | "long": z.string(), |
| 87 | 87 | "pubDate": z.string(), |
| 88 | 88 | "title": z.string(), |
| 89 | -}); | |
| 89 | +}).strict(); | |
| 90 | 90 | export type Item = z.infer<typeof ItemSchema>; |
| 91 | 91 | |
| 92 | 92 | export const ChannelSchema = z.object({ |
| @@ -103,12 +103,12 @@ export const ChannelSchema = z.object({ | ||
| 103 | 103 | "ttl": z.string().regex(/^-?\d+$/), |
| 104 | 104 | "units": UnitsSchema, |
| 105 | 105 | "wind": WindSchema, |
| 106 | -}); | |
| 106 | +}).strict(); | |
| 107 | 107 | export type Channel = z.infer<typeof ChannelSchema>; |
| 108 | 108 | |
| 109 | 109 | export const ResultsSchema = z.object({ |
| 110 | 110 | "channel": ChannelSchema, |
| 111 | -}); | |
| 111 | +}).strict(); | |
| 112 | 112 | export type Results = z.infer<typeof ResultsSchema>; |
| 113 | 113 | |
| 114 | 114 | export const QuerySchema = z.object({ |
| @@ -116,10 +116,10 @@ export const QuerySchema = z.object({ | ||
| 116 | 116 | "created": z.coerce.date(), |
| 117 | 117 | "lang": z.string(), |
| 118 | 118 | "results": ResultsSchema, |
| 119 | -}); | |
| 119 | +}).strict(); | |
| 120 | 120 | export type Query = z.infer<typeof QuerySchema>; |
| 121 | 121 | |
| 122 | 122 | export const TopLevelSchema = z.object({ |
| 123 | 123 | "query": QuerySchema, |
| 124 | -}); | |
| 124 | +}).strict(); | |
| 125 | 125 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +10 −10test/inputs/json/misc/26b49.json
Mtypescript-zoddefault / TopLevel.ts+10 −10
| @@ -20,7 +20,7 @@ export const The480_WStillSchema = z.object({ | ||
| 20 | 20 | "size": z.string().regex(/^-?\d+$/).optional(), |
| 21 | 21 | "url": z.string(), |
| 22 | 22 | "width": z.string().regex(/^-?\d+$/), |
| 23 | -}); | |
| 23 | +}).strict(); | |
| 24 | 24 | export type The480_WStill = z.infer<typeof The480_WStillSchema>; |
| 25 | 25 | |
| 26 | 26 | export const DownsizedSmallSchema = z.object({ |
| @@ -28,7 +28,7 @@ export const DownsizedSmallSchema = z.object({ | ||
| 28 | 28 | "mp4": z.string(), |
| 29 | 29 | "mp4_size": z.string().regex(/^-?\d+$/), |
| 30 | 30 | "width": z.string().regex(/^-?\d+$/), |
| 31 | -}); | |
| 31 | +}).strict(); | |
| 32 | 32 | export type DownsizedSmall = z.infer<typeof DownsizedSmallSchema>; |
| 33 | 33 | |
| 34 | 34 | export const FixedHeightSchema = z.object({ |
| @@ -42,13 +42,13 @@ export const FixedHeightSchema = z.object({ | ||
| 42 | 42 | "webp": z.string(), |
| 43 | 43 | "webp_size": z.string().regex(/^-?\d+$/), |
| 44 | 44 | "width": z.string().regex(/^-?\d+$/), |
| 45 | -}); | |
| 45 | +}).strict(); | |
| 46 | 46 | export type FixedHeight = z.infer<typeof FixedHeightSchema>; |
| 47 | 47 | |
| 48 | 48 | export const LoopingSchema = z.object({ |
| 49 | 49 | "mp4": z.string(), |
| 50 | 50 | "mp4_size": z.string().regex(/^-?\d+$/), |
| 51 | -}); | |
| 51 | +}).strict(); | |
| 52 | 52 | export type Looping = z.infer<typeof LoopingSchema>; |
| 53 | 53 | |
| 54 | 54 | export const UserSchema = z.object({ |
| @@ -58,21 +58,21 @@ export const UserSchema = z.object({ | ||
| 58 | 58 | "profile_url": z.string(), |
| 59 | 59 | "twitter": z.string().optional(), |
| 60 | 60 | "username": z.string(), |
| 61 | -}); | |
| 61 | +}).strict(); | |
| 62 | 62 | export type User = z.infer<typeof UserSchema>; |
| 63 | 63 | |
| 64 | 64 | export const MetaSchema = z.object({ |
| 65 | 65 | "msg": z.string(), |
| 66 | 66 | "response_id": z.string(), |
| 67 | 67 | "status": z.number().int(), |
| 68 | -}); | |
| 68 | +}).strict(); | |
| 69 | 69 | export type Meta = z.infer<typeof MetaSchema>; |
| 70 | 70 | |
| 71 | 71 | export const PaginationSchema = z.object({ |
| 72 | 72 | "count": z.number().int(), |
| 73 | 73 | "offset": z.number().int(), |
| 74 | 74 | "total_count": z.number().int(), |
| 75 | -}); | |
| 75 | +}).strict(); | |
| 76 | 76 | export type Pagination = z.infer<typeof PaginationSchema>; |
| 77 | 77 | |
| 78 | 78 | export const ImagesSchema = z.object({ |
| @@ -100,7 +100,7 @@ export const ImagesSchema = z.object({ | ||
| 100 | 100 | "preview_gif": The480_WStillSchema, |
| 101 | 101 | "preview_webp": The480_WStillSchema, |
| 102 | 102 | "480w_still": The480_WStillSchema.optional(), |
| 103 | -}); | |
| 103 | +}).strict(); | |
| 104 | 104 | export type Images = z.infer<typeof ImagesSchema>; |
| 105 | 105 | |
| 106 | 106 | export const DatumSchema = z.object({ |
| @@ -122,12 +122,12 @@ export const DatumSchema = z.object({ | ||
| 122 | 122 | "url": z.string(), |
| 123 | 123 | "user": UserSchema.optional(), |
| 124 | 124 | "username": z.string(), |
| 125 | -}); | |
| 125 | +}).strict(); | |
| 126 | 126 | export type Datum = z.infer<typeof DatumSchema>; |
| 127 | 127 | |
| 128 | 128 | export const TopLevelSchema = z.object({ |
| 129 | 129 | "data": z.array(DatumSchema), |
| 130 | 130 | "meta": MetaSchema, |
| 131 | 131 | "pagination": PaginationSchema, |
| 132 | -}); | |
| 132 | +}).strict(); | |
| 133 | 133 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +24 −24test/inputs/json/misc/26c9c.json
Mtypescript-zoddefault / TopLevel.ts+24 −24
| @@ -4,7 +4,7 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TopSchema = z.object({ |
| 5 | 5 | "count": z.number().int(), |
| 6 | 6 | "item": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Top = z.infer<typeof TopSchema>; |
| 9 | 9 | |
| 10 | 10 | export const FormatSchema = z.object({ |
| @@ -12,14 +12,14 @@ export const FormatSchema = z.object({ | ||
| 12 | 12 | "noCommas": z.enum(["true", "false"]).optional(), |
| 13 | 13 | "precisionStyle": z.string().optional(), |
| 14 | 14 | "view": z.string().optional(), |
| 15 | -}); | |
| 15 | +}).strict(); | |
| 16 | 16 | export type Format = z.infer<typeof FormatSchema>; |
| 17 | 17 | |
| 18 | 18 | export const GrantSchema = z.object({ |
| 19 | 19 | "flags": z.array(z.string()), |
| 20 | 20 | "inherited": z.boolean(), |
| 21 | 21 | "type": z.string(), |
| 22 | -}); | |
| 22 | +}).strict(); | |
| 23 | 23 | export type Grant = z.infer<typeof GrantSchema>; |
| 24 | 24 | |
| 25 | 25 | export const AttachmentSchema = z.object({ |
| @@ -27,25 +27,25 @@ export const AttachmentSchema = z.object({ | ||
| 27 | 27 | "blobId": z.string(), |
| 28 | 28 | "filename": z.string(), |
| 29 | 29 | "name": z.string(), |
| 30 | -}); | |
| 30 | +}).strict(); | |
| 31 | 31 | export type Attachment = z.infer<typeof AttachmentSchema>; |
| 32 | 32 | |
| 33 | 33 | export const AdditionalResourcesSchema = z.object({ |
| 34 | 34 | "See Also ": z.string(), |
| 35 | 35 | "See Also": z.string(), |
| 36 | -}); | |
| 36 | +}).strict(); | |
| 37 | 37 | export type AdditionalResources = z.infer<typeof AdditionalResourcesSchema>; |
| 38 | 38 | |
| 39 | 39 | export const CommonCoreSchema = z.object({ |
| 40 | 40 | "Contact Email": z.string(), |
| 41 | 41 | "Contact Name": z.string(), |
| 42 | 42 | "Publisher": z.string(), |
| 43 | -}); | |
| 43 | +}).strict(); | |
| 44 | 44 | export type CommonCore = z.infer<typeof CommonCoreSchema>; |
| 45 | 45 | |
| 46 | 46 | export const DatasetInformationSchema = z.object({ |
| 47 | 47 | "Agency": z.string(), |
| 48 | -}); | |
| 48 | +}).strict(); | |
| 49 | 49 | export type DatasetInformation = z.infer<typeof DatasetInformationSchema>; |
| 50 | 50 | |
| 51 | 51 | export const DatasetSummarySchema = z.object({ |
| @@ -58,23 +58,23 @@ export const DatasetSummarySchema = z.object({ | ||
| 58 | 58 | "Posting Frequency": z.string(), |
| 59 | 59 | "Time Period": z.string(), |
| 60 | 60 | "Units": z.string(), |
| 61 | -}); | |
| 61 | +}).strict(); | |
| 62 | 62 | export type DatasetSummary = z.infer<typeof DatasetSummarySchema>; |
| 63 | 63 | |
| 64 | 64 | export const NotesSchema = z.object({ |
| 65 | 65 | "Notes": z.string(), |
| 66 | -}); | |
| 66 | +}).strict(); | |
| 67 | 67 | export type Notes = z.infer<typeof NotesSchema>; |
| 68 | 68 | |
| 69 | 69 | export const OrderSchema = z.object({ |
| 70 | 70 | "ascending": z.boolean(), |
| 71 | 71 | "columnFieldName": z.string(), |
| 72 | -}); | |
| 72 | +}).strict(); | |
| 73 | 73 | export type Order = z.infer<typeof OrderSchema>; |
| 74 | 74 | |
| 75 | 75 | export const VisibleSchema = z.object({ |
| 76 | 76 | "table": z.boolean(), |
| 77 | -}); | |
| 77 | +}).strict(); | |
| 78 | 78 | export type Visible = z.infer<typeof VisibleSchema>; |
| 79 | 79 | |
| 80 | 80 | export const OwnerSchema = z.object({ |
| @@ -86,13 +86,13 @@ export const OwnerSchema = z.object({ | ||
| 86 | 86 | "rights": z.array(z.string()), |
| 87 | 87 | "roleName": z.string(), |
| 88 | 88 | "screenName": z.string(), |
| 89 | -}); | |
| 89 | +}).strict(); | |
| 90 | 90 | export type Owner = z.infer<typeof OwnerSchema>; |
| 91 | 91 | |
| 92 | 92 | export const ExpressionSchema = z.object({ |
| 93 | 93 | "columnId": z.number().int(), |
| 94 | 94 | "type": z.string(), |
| 95 | -}); | |
| 95 | +}).strict(); | |
| 96 | 96 | export type Expression = z.infer<typeof ExpressionSchema>; |
| 97 | 97 | |
| 98 | 98 | export const CachedContentsSchema = z.object({ |
| @@ -103,7 +103,7 @@ export const CachedContentsSchema = z.object({ | ||
| 103 | 103 | "smallest": z.string(), |
| 104 | 104 | "sum": z.string().regex(/^-?\d+$/).optional(), |
| 105 | 105 | "top": z.array(TopSchema), |
| 106 | -}); | |
| 106 | +}).strict(); | |
| 107 | 107 | export type CachedContents = z.infer<typeof CachedContentsSchema>; |
| 108 | 108 | |
| 109 | 109 | export const CustomFieldsSchema = z.object({ |
| @@ -112,23 +112,23 @@ export const CustomFieldsSchema = z.object({ | ||
| 112 | 112 | "Dataset Information": DatasetInformationSchema, |
| 113 | 113 | "Dataset Summary": DatasetSummarySchema, |
| 114 | 114 | "Notes": NotesSchema, |
| 115 | -}); | |
| 115 | +}).strict(); | |
| 116 | 116 | export type CustomFields = z.infer<typeof CustomFieldsSchema>; |
| 117 | 117 | |
| 118 | 118 | export const JsonQuerySchema = z.object({ |
| 119 | 119 | "order": z.array(OrderSchema), |
| 120 | -}); | |
| 120 | +}).strict(); | |
| 121 | 121 | export type JsonQuery = z.infer<typeof JsonQuerySchema>; |
| 122 | 122 | |
| 123 | 123 | export const RenderTypeConfigSchema = z.object({ |
| 124 | 124 | "visible": VisibleSchema, |
| 125 | -}); | |
| 125 | +}).strict(); | |
| 126 | 126 | export type RenderTypeConfig = z.infer<typeof RenderTypeConfigSchema>; |
| 127 | 127 | |
| 128 | 128 | export const OrderBySchema = z.object({ |
| 129 | 129 | "ascending": z.boolean(), |
| 130 | 130 | "expression": ExpressionSchema, |
| 131 | -}); | |
| 131 | +}).strict(); | |
| 132 | 132 | export type OrderBy = z.infer<typeof OrderBySchema>; |
| 133 | 133 | |
| 134 | 134 | export const ColumnSchema = z.object({ |
| @@ -143,7 +143,7 @@ export const ColumnSchema = z.object({ | ||
| 143 | 143 | "renderTypeName": z.string(), |
| 144 | 144 | "tableColumnId": z.number().int().optional(), |
| 145 | 145 | "width": z.number().int().optional(), |
| 146 | -}); | |
| 146 | +}).strict(); | |
| 147 | 147 | export type Column = z.infer<typeof ColumnSchema>; |
| 148 | 148 | |
| 149 | 149 | export const MetadataSchema = z.object({ |
| @@ -153,12 +153,12 @@ export const MetadataSchema = z.object({ | ||
| 153 | 153 | "jsonQuery": JsonQuerySchema, |
| 154 | 154 | "rdfSubject": z.string().regex(/^-?\d+$/), |
| 155 | 155 | "renderTypeConfig": RenderTypeConfigSchema, |
| 156 | -}); | |
| 156 | +}).strict(); | |
| 157 | 157 | export type Metadata = z.infer<typeof MetadataSchema>; |
| 158 | 158 | |
| 159 | 159 | export const QuerySchema = z.object({ |
| 160 | 160 | "orderBys": z.array(OrderBySchema), |
| 161 | -}); | |
| 161 | +}).strict(); | |
| 162 | 162 | export type Query = z.infer<typeof QuerySchema>; |
| 163 | 163 | |
| 164 | 164 | export const ViewSchema = z.object({ |
| @@ -200,16 +200,16 @@ export const ViewSchema = z.object({ | ||
| 200 | 200 | "viewCount": z.number().int(), |
| 201 | 201 | "viewLastModified": z.number().int(), |
| 202 | 202 | "viewType": z.string(), |
| 203 | -}); | |
| 203 | +}).strict(); | |
| 204 | 204 | export type View = z.infer<typeof ViewSchema>; |
| 205 | 205 | |
| 206 | 206 | export const MetaSchema = z.object({ |
| 207 | 207 | "view": ViewSchema, |
| 208 | -}); | |
| 208 | +}).strict(); | |
| 209 | 209 | export type Meta = z.infer<typeof MetaSchema>; |
| 210 | 210 | |
| 211 | 211 | export const TopLevelSchema = z.object({ |
| 212 | 212 | "data": z.array(z.array(z.union([z.null(), z.number().int(), z.string()]))), |
| 213 | 213 | "meta": MetaSchema, |
| 214 | -}); | |
| 214 | +}).strict(); | |
| 215 | 215 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +11 −11test/inputs/json/misc/27332.json
Mtypescript-zoddefault / TopLevel.ts+11 −11
| @@ -59,7 +59,7 @@ export const OembedSchema = z.object({ | ||
| 59 | 59 | "type": z.string(), |
| 60 | 60 | "version": z.string(), |
| 61 | 61 | "width": z.number().int(), |
| 62 | -}); | |
| 62 | +}).strict(); | |
| 63 | 63 | export type Oembed = z.infer<typeof OembedSchema>; |
| 64 | 64 | |
| 65 | 65 | export const MediaEmbedSchema = z.object({ |
| @@ -67,24 +67,24 @@ export const MediaEmbedSchema = z.object({ | ||
| 67 | 67 | "height": z.number().int().optional(), |
| 68 | 68 | "scrolling": z.boolean().optional(), |
| 69 | 69 | "width": z.number().int().optional(), |
| 70 | -}); | |
| 70 | +}).strict(); | |
| 71 | 71 | export type MediaEmbed = z.infer<typeof MediaEmbedSchema>; |
| 72 | 72 | |
| 73 | 73 | export const SourceSchema = z.object({ |
| 74 | 74 | "height": z.number().int(), |
| 75 | 75 | "url": z.string(), |
| 76 | 76 | "width": z.number().int(), |
| 77 | -}); | |
| 77 | +}).strict(); | |
| 78 | 78 | export type Source = z.infer<typeof SourceSchema>; |
| 79 | 79 | |
| 80 | 80 | export const VariantsSchema = z.object({ |
| 81 | -}); | |
| 81 | +}).strict(); | |
| 82 | 82 | export type Variants = z.infer<typeof VariantsSchema>; |
| 83 | 83 | |
| 84 | 84 | export const MediaSchema = z.object({ |
| 85 | 85 | "oembed": OembedSchema, |
| 86 | 86 | "type": DomainSchema, |
| 87 | -}); | |
| 87 | +}).strict(); | |
| 88 | 88 | export type Media = z.infer<typeof MediaSchema>; |
| 89 | 89 | |
| 90 | 90 | export const ImageSchema = z.object({ |
| @@ -92,13 +92,13 @@ export const ImageSchema = z.object({ | ||
| 92 | 92 | "resolutions": z.array(SourceSchema), |
| 93 | 93 | "source": SourceSchema, |
| 94 | 94 | "variants": VariantsSchema, |
| 95 | -}); | |
| 95 | +}).strict(); | |
| 96 | 96 | export type Image = z.infer<typeof ImageSchema>; |
| 97 | 97 | |
| 98 | 98 | export const PreviewSchema = z.object({ |
| 99 | 99 | "enabled": z.boolean(), |
| 100 | 100 | "images": z.array(ImageSchema), |
| 101 | -}); | |
| 101 | +}).strict(); | |
| 102 | 102 | export type Preview = z.infer<typeof PreviewSchema>; |
| 103 | 103 | |
| 104 | 104 | export const ChildDataSchema = z.object({ |
| @@ -166,13 +166,13 @@ export const ChildDataSchema = z.object({ | ||
| 166 | 166 | "user_reports": z.array(z.any()), |
| 167 | 167 | "view_count": z.null(), |
| 168 | 168 | "visited": z.boolean(), |
| 169 | -}); | |
| 169 | +}).strict(); | |
| 170 | 170 | export type ChildData = z.infer<typeof ChildDataSchema>; |
| 171 | 171 | |
| 172 | 172 | export const ChildSchema = z.object({ |
| 173 | 173 | "data": ChildDataSchema, |
| 174 | 174 | "kind": KindSchema, |
| 175 | -}); | |
| 175 | +}).strict(); | |
| 176 | 176 | export type Child = z.infer<typeof ChildSchema>; |
| 177 | 177 | |
| 178 | 178 | export const TopLevelDataSchema = z.object({ |
| @@ -180,11 +180,11 @@ export const TopLevelDataSchema = z.object({ | ||
| 180 | 180 | "before": z.null(), |
| 181 | 181 | "children": z.array(ChildSchema), |
| 182 | 182 | "modhash": z.string(), |
| 183 | -}); | |
| 183 | +}).strict(); | |
| 184 | 184 | export type TopLevelData = z.infer<typeof TopLevelDataSchema>; |
| 185 | 185 | |
| 186 | 186 | export const TopLevelSchema = z.object({ |
| 187 | 187 | "data": TopLevelDataSchema, |
| 188 | 188 | "kind": z.string(), |
| 189 | -}); | |
| 189 | +}).strict(); | |
| 190 | 190 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +10 −10test/inputs/json/misc/29f47.json
Mtypescript-zoddefault / TopLevel.ts+10 −10
| @@ -51,26 +51,26 @@ export const KindSchema = z.enum([ | ||
| 51 | 51 | export type Kind = z.infer<typeof KindSchema>; |
| 52 | 52 | |
| 53 | 53 | export const MediaEmbedSchema = z.object({ |
| 54 | -}); | |
| 54 | +}).strict(); | |
| 55 | 55 | export type MediaEmbed = z.infer<typeof MediaEmbedSchema>; |
| 56 | 56 | |
| 57 | 57 | export const SourceSchema = z.object({ |
| 58 | 58 | "height": z.number().int(), |
| 59 | 59 | "url": z.string(), |
| 60 | 60 | "width": z.number().int(), |
| 61 | -}); | |
| 61 | +}).strict(); | |
| 62 | 62 | export type Source = z.infer<typeof SourceSchema>; |
| 63 | 63 | |
| 64 | 64 | export const GifSchema = z.object({ |
| 65 | 65 | "resolutions": z.array(SourceSchema), |
| 66 | 66 | "source": SourceSchema, |
| 67 | -}); | |
| 67 | +}).strict(); | |
| 68 | 68 | export type Gif = z.infer<typeof GifSchema>; |
| 69 | 69 | |
| 70 | 70 | export const VariantsSchema = z.object({ |
| 71 | 71 | "gif": GifSchema.optional(), |
| 72 | 72 | "mp4": GifSchema.optional(), |
| 73 | -}); | |
| 73 | +}).strict(); | |
| 74 | 74 | export type Variants = z.infer<typeof VariantsSchema>; |
| 75 | 75 | |
| 76 | 76 | export const ImageSchema = z.object({ |
| @@ -78,13 +78,13 @@ export const ImageSchema = z.object({ | ||
| 78 | 78 | "resolutions": z.array(SourceSchema), |
| 79 | 79 | "source": SourceSchema, |
| 80 | 80 | "variants": VariantsSchema, |
| 81 | -}); | |
| 81 | +}).strict(); | |
| 82 | 82 | export type Image = z.infer<typeof ImageSchema>; |
| 83 | 83 | |
| 84 | 84 | export const PreviewSchema = z.object({ |
| 85 | 85 | "enabled": z.boolean(), |
| 86 | 86 | "images": z.array(ImageSchema), |
| 87 | -}); | |
| 87 | +}).strict(); | |
| 88 | 88 | export type Preview = z.infer<typeof PreviewSchema>; |
| 89 | 89 | |
| 90 | 90 | export const ChildDataSchema = z.object({ |
| @@ -152,13 +152,13 @@ export const ChildDataSchema = z.object({ | ||
| 152 | 152 | "user_reports": z.array(z.any()), |
| 153 | 153 | "view_count": z.null(), |
| 154 | 154 | "visited": z.boolean(), |
| 155 | -}); | |
| 155 | +}).strict(); | |
| 156 | 156 | export type ChildData = z.infer<typeof ChildDataSchema>; |
| 157 | 157 | |
| 158 | 158 | export const ChildSchema = z.object({ |
| 159 | 159 | "data": ChildDataSchema, |
| 160 | 160 | "kind": KindSchema, |
| 161 | -}); | |
| 161 | +}).strict(); | |
| 162 | 162 | export type Child = z.infer<typeof ChildSchema>; |
| 163 | 163 | |
| 164 | 164 | export const TopLevelDataSchema = z.object({ |
| @@ -166,11 +166,11 @@ export const TopLevelDataSchema = z.object({ | ||
| 166 | 166 | "before": z.null(), |
| 167 | 167 | "children": z.array(ChildSchema), |
| 168 | 168 | "modhash": z.string(), |
| 169 | -}); | |
| 169 | +}).strict(); | |
| 170 | 170 | export type TopLevelData = z.infer<typeof TopLevelDataSchema>; |
| 171 | 171 | |
| 172 | 172 | export const TopLevelSchema = z.object({ |
| 173 | 173 | "data": TopLevelDataSchema, |
| 174 | 174 | "kind": z.string(), |
| 175 | -}); | |
| 175 | +}).strict(); | |
| 176 | 176 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +5 −5test/inputs/json/misc/2d4e2.json
Mtypescript-zoddefault / TopLevel.ts+5 −5
| @@ -82,7 +82,7 @@ export const MetaSchema = z.object({ | ||
| 82 | 82 | "limit": z.number().int(), |
| 83 | 83 | "offset": z.number().int(), |
| 84 | 84 | "total_count": z.number().int(), |
| 85 | -}); | |
| 85 | +}).strict(); | |
| 86 | 86 | export type Meta = z.infer<typeof MetaSchema>; |
| 87 | 87 | |
| 88 | 88 | export const ExtraSchema = z.object({ |
| @@ -91,7 +91,7 @@ export const ExtraSchema = z.object({ | ||
| 91 | 91 | "fax": z.string().optional(), |
| 92 | 92 | "office": z.string(), |
| 93 | 93 | "rss_url": z.string().optional(), |
| 94 | -}); | |
| 94 | +}).strict(); | |
| 95 | 95 | export type Extra = z.infer<typeof ExtraSchema>; |
| 96 | 96 | |
| 97 | 97 | export const PersonSchema = z.object({ |
| @@ -113,7 +113,7 @@ export const PersonSchema = z.object({ | ||
| 113 | 113 | "sortname": z.string(), |
| 114 | 114 | "twitterid": z.union([z.null(), z.string()]), |
| 115 | 115 | "youtubeid": z.union([z.null(), z.string()]), |
| 116 | -}); | |
| 116 | +}).strict(); | |
| 117 | 117 | export type Person = z.infer<typeof PersonSchema>; |
| 118 | 118 | |
| 119 | 119 | export const ObjectElementSchema = z.object({ |
| @@ -140,11 +140,11 @@ export const ObjectElementSchema = z.object({ | ||
| 140 | 140 | "title": TitleSchema, |
| 141 | 141 | "title_long": RoleTypeLabelSchema, |
| 142 | 142 | "website": z.string(), |
| 143 | -}); | |
| 143 | +}).strict(); | |
| 144 | 144 | export type ObjectElement = z.infer<typeof ObjectElementSchema>; |
| 145 | 145 | |
| 146 | 146 | export const TopLevelSchema = z.object({ |
| 147 | 147 | "meta": MetaSchema, |
| 148 | 148 | "objects": z.array(ObjectElementSchema), |
| 149 | -}); | |
| 149 | +}).strict(); | |
| 150 | 150 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +3 −3test/inputs/json/misc/2df80.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -57,7 +57,7 @@ export type Value = z.infer<typeof ValueSchema>; | ||
| 57 | 57 | export const AdminregionSchema = z.object({ |
| 58 | 58 | "id": IdSchema, |
| 59 | 59 | "value": ValueSchema, |
| 60 | -}); | |
| 60 | +}).strict(); | |
| 61 | 61 | export type Adminregion = z.infer<typeof AdminregionSchema>; |
| 62 | 62 | |
| 63 | 63 | export const FluffyTopLevelSchema = z.object({ |
| @@ -65,7 +65,7 @@ export const FluffyTopLevelSchema = z.object({ | ||
| 65 | 65 | "pages": z.number().int(), |
| 66 | 66 | "per_page": z.string().regex(/^-?\d+$/), |
| 67 | 67 | "total": z.number().int(), |
| 68 | -}); | |
| 68 | +}).strict(); | |
| 69 | 69 | export type FluffyTopLevel = z.infer<typeof FluffyTopLevelSchema>; |
| 70 | 70 | |
| 71 | 71 | export const PurpleTopLevelSchema = z.object({ |
| @@ -79,7 +79,7 @@ export const PurpleTopLevelSchema = z.object({ | ||
| 79 | 79 | "longitude": z.string(), |
| 80 | 80 | "name": z.string(), |
| 81 | 81 | "region": AdminregionSchema, |
| 82 | -}); | |
| 82 | +}).strict(); | |
| 83 | 83 | export type PurpleTopLevel = z.infer<typeof PurpleTopLevelSchema>; |
| 84 | 84 | |
| 85 | 85 | export const TopLevelSchema = z.array(z.union([z.array(PurpleTopLevelSchema), FluffyTopLevelSchema])); |
Test case
1 generated file · +4 −4test/inputs/json/misc/31189.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -8,13 +8,13 @@ export const RatesSchema = z.object({ | ||
| 8 | 8 | "reduced2": z.number().optional(), |
| 9 | 9 | "standard": z.number(), |
| 10 | 10 | "super_reduced": z.number().optional(), |
| 11 | -}); | |
| 11 | +}).strict(); | |
| 12 | 12 | export type Rates = z.infer<typeof RatesSchema>; |
| 13 | 13 | |
| 14 | 14 | export const PeriodSchema = z.object({ |
| 15 | 15 | "effective_from": z.string(), |
| 16 | 16 | "rates": RatesSchema, |
| 17 | -}); | |
| 17 | +}).strict(); | |
| 18 | 18 | export type Period = z.infer<typeof PeriodSchema>; |
| 19 | 19 | |
| 20 | 20 | export const RateSchema = z.object({ |
| @@ -22,12 +22,12 @@ export const RateSchema = z.object({ | ||
| 22 | 22 | "country_code": z.string(), |
| 23 | 23 | "name": z.string(), |
| 24 | 24 | "periods": z.array(PeriodSchema), |
| 25 | -}); | |
| 25 | +}).strict(); | |
| 26 | 26 | export type Rate = z.infer<typeof RateSchema>; |
| 27 | 27 | |
| 28 | 28 | export const TopLevelSchema = z.object({ |
| 29 | 29 | "details": z.string(), |
| 30 | 30 | "rates": z.array(RateSchema), |
| 31 | 31 | "version": z.null(), |
| 32 | -}); | |
| 32 | +}).strict(); | |
| 33 | 33 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +5 −5test/inputs/json/misc/32431.json
Mtypescript-zoddefault / TopLevel.ts+5 −5
| @@ -36,7 +36,7 @@ export type FeatureType = z.infer<typeof FeatureTypeSchema>; | ||
| 36 | 36 | export const GeometrySchema = z.object({ |
| 37 | 37 | "coordinates": z.array(z.number()), |
| 38 | 38 | "type": GeometryTypeSchema, |
| 39 | -}); | |
| 39 | +}).strict(); | |
| 40 | 40 | export type Geometry = z.infer<typeof GeometrySchema>; |
| 41 | 41 | |
| 42 | 42 | export const PropertiesSchema = z.object({ |
| @@ -66,7 +66,7 @@ export const PropertiesSchema = z.object({ | ||
| 66 | 66 | "tz": z.number().int(), |
| 67 | 67 | "updated": z.number().int(), |
| 68 | 68 | "url": z.string(), |
| 69 | -}); | |
| 69 | +}).strict(); | |
| 70 | 70 | export type Properties = z.infer<typeof PropertiesSchema>; |
| 71 | 71 | |
| 72 | 72 | export const MetadataSchema = z.object({ |
| @@ -76,7 +76,7 @@ export const MetadataSchema = z.object({ | ||
| 76 | 76 | "status": z.number().int(), |
| 77 | 77 | "title": z.string(), |
| 78 | 78 | "url": z.string(), |
| 79 | -}); | |
| 79 | +}).strict(); | |
| 80 | 80 | export type Metadata = z.infer<typeof MetadataSchema>; |
| 81 | 81 | |
| 82 | 82 | export const FeatureSchema = z.object({ |
| @@ -84,7 +84,7 @@ export const FeatureSchema = z.object({ | ||
| 84 | 84 | "id": z.string(), |
| 85 | 85 | "properties": PropertiesSchema, |
| 86 | 86 | "type": FeatureTypeSchema, |
| 87 | -}); | |
| 87 | +}).strict(); | |
| 88 | 88 | export type Feature = z.infer<typeof FeatureSchema>; |
| 89 | 89 | |
| 90 | 90 | export const TopLevelSchema = z.object({ |
| @@ -92,5 +92,5 @@ export const TopLevelSchema = z.object({ | ||
| 92 | 92 | "features": z.array(FeatureSchema), |
| 93 | 93 | "metadata": MetadataSchema, |
| 94 | 94 | "type": z.string(), |
| 95 | -}); | |
| 95 | +}).strict(); | |
| 96 | 96 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/32d5c.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -10,7 +10,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 10 | 10 | "PersonID": z.number().int(), |
| 11 | 11 | "PhotoURL": z.string(), |
| 12 | 12 | "PreferredName": z.string(), |
| 13 | -}); | |
| 13 | +}).strict(); | |
| 14 | 14 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 15 | 15 | |
| 16 | 16 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +4 −4test/inputs/json/misc/337ed.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -23,7 +23,7 @@ export const ResultTypeSchema = z.enum([ | ||
| 23 | 23 | export type ResultType = z.infer<typeof ResultTypeSchema>; |
| 24 | 24 | |
| 25 | 25 | export const FacetsSchema = z.object({ |
| 26 | -}); | |
| 26 | +}).strict(); | |
| 27 | 27 | export type Facets = z.infer<typeof FacetsSchema>; |
| 28 | 28 | |
| 29 | 29 | export const CustomIncomeSchema = z.object({ |
| @@ -35,7 +35,7 @@ export const CustomIncomeSchema = z.object({ | ||
| 35 | 35 | "type": CustomIncomeTypeSchema, |
| 36 | 36 | "updated_at": z.coerce.date(), |
| 37 | 37 | "uri": z.string(), |
| 38 | -}); | |
| 38 | +}).strict(); | |
| 39 | 39 | export type CustomIncome = z.infer<typeof CustomIncomeSchema>; |
| 40 | 40 | |
| 41 | 41 | export const ResultSchema = z.object({ |
| @@ -71,7 +71,7 @@ export const ResultSchema = z.object({ | ||
| 71 | 71 | "type": ResultTypeSchema, |
| 72 | 72 | "updated_at": z.coerce.date(), |
| 73 | 73 | "uri": z.string(), |
| 74 | -}); | |
| 74 | +}).strict(); | |
| 75 | 75 | export type Result = z.infer<typeof ResultSchema>; |
| 76 | 76 | |
| 77 | 77 | export const TopLevelSchema = z.object({ |
| @@ -82,5 +82,5 @@ export const TopLevelSchema = z.object({ | ||
| 82 | 82 | "offset": z.number().int(), |
| 83 | 83 | "previous": z.boolean(), |
| 84 | 84 | "results": z.array(ResultSchema), |
| 85 | -}); | |
| 85 | +}).strict(); | |
| 86 | 86 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/misc/33d2e.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -23,7 +23,7 @@ export const AffiliationClassSchema = z.object({ | ||
| 23 | 23 | "city": z.string().optional(), |
| 24 | 24 | "country": z.string().optional(), |
| 25 | 25 | "name": z.string().optional(), |
| 26 | -}); | |
| 26 | +}).strict(); | |
| 27 | 27 | export type AffiliationClass = z.infer<typeof AffiliationClassSchema>; |
| 28 | 28 | |
| 29 | 29 | export const PrizeSchema = z.object({ |
| @@ -33,7 +33,7 @@ export const PrizeSchema = z.object({ | ||
| 33 | 33 | "overallMotivation": z.string().optional(), |
| 34 | 34 | "share": z.string().regex(/^-?\d+$/).optional(), |
| 35 | 35 | "year": z.string().regex(/^-?\d+$/).optional(), |
| 36 | -}); | |
| 36 | +}).strict(); | |
| 37 | 37 | export type Prize = z.infer<typeof PrizeSchema>; |
| 38 | 38 | |
| 39 | 39 | export const LaureateSchema = z.object({ |
| @@ -50,10 +50,10 @@ export const LaureateSchema = z.object({ | ||
| 50 | 50 | "id": z.string().regex(/^-?\d+$/), |
| 51 | 51 | "prizes": z.array(PrizeSchema), |
| 52 | 52 | "surname": z.string().optional(), |
| 53 | -}); | |
| 53 | +}).strict(); | |
| 54 | 54 | export type Laureate = z.infer<typeof LaureateSchema>; |
| 55 | 55 | |
| 56 | 56 | export const TopLevelSchema = z.object({ |
| 57 | 57 | "laureates": z.array(LaureateSchema), |
| 58 | -}); | |
| 58 | +}).strict(); | |
| 59 | 59 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +6 −6test/inputs/json/misc/34702.json
Mtypescript-zoddefault / TopLevel.ts+6 −6
| @@ -65,13 +65,13 @@ export type FeatureType = z.infer<typeof FeatureTypeSchema>; | ||
| 65 | 65 | |
| 66 | 66 | export const CrsPropertiesSchema = z.object({ |
| 67 | 67 | "name": z.string(), |
| 68 | -}); | |
| 68 | +}).strict(); | |
| 69 | 69 | export type CrsProperties = z.infer<typeof CrsPropertiesSchema>; |
| 70 | 70 | |
| 71 | 71 | export const GeometrySchema = z.object({ |
| 72 | 72 | "coordinates": z.array(z.number()), |
| 73 | 73 | "type": GeometryTypeSchema, |
| 74 | -}); | |
| 74 | +}).strict(); | |
| 75 | 75 | export type Geometry = z.infer<typeof GeometrySchema>; |
| 76 | 76 | |
| 77 | 77 | export const FeaturePropertiesSchema = z.object({ |
| @@ -90,13 +90,13 @@ export const FeaturePropertiesSchema = z.object({ | ||
| 90 | 90 | "street": z.string(), |
| 91 | 91 | "suburb": z.string(), |
| 92 | 92 | "type": z.union([z.null(), PropertiesTypeSchema]), |
| 93 | -}); | |
| 93 | +}).strict(); | |
| 94 | 94 | export type FeatureProperties = z.infer<typeof FeaturePropertiesSchema>; |
| 95 | 95 | |
| 96 | 96 | export const CrsSchema = z.object({ |
| 97 | 97 | "properties": CrsPropertiesSchema, |
| 98 | 98 | "type": z.string(), |
| 99 | -}); | |
| 99 | +}).strict(); | |
| 100 | 100 | export type Crs = z.infer<typeof CrsSchema>; |
| 101 | 101 | |
| 102 | 102 | export const FeatureSchema = z.object({ |
| @@ -105,7 +105,7 @@ export const FeatureSchema = z.object({ | ||
| 105 | 105 | "id": z.string(), |
| 106 | 106 | "properties": FeaturePropertiesSchema, |
| 107 | 107 | "type": FeatureTypeSchema, |
| 108 | -}); | |
| 108 | +}).strict(); | |
| 109 | 109 | export type Feature = z.infer<typeof FeatureSchema>; |
| 110 | 110 | |
| 111 | 111 | export const TopLevelSchema = z.object({ |
| @@ -113,5 +113,5 @@ export const TopLevelSchema = z.object({ | ||
| 113 | 113 | "features": z.array(FeatureSchema), |
| 114 | 114 | "totalFeatures": z.number().int(), |
| 115 | 115 | "type": z.string(), |
| 116 | -}); | |
| 116 | +}).strict(); | |
| 117 | 117 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/misc/3536b.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -19,20 +19,20 @@ export type Keyword = z.infer<typeof KeywordSchema>; | ||
| 19 | 19 | export const IdentifierSchema = z.object({ |
| 20 | 20 | "identifier": z.string(), |
| 21 | 21 | "scheme": SchemeSchema, |
| 22 | -}); | |
| 22 | +}).strict(); | |
| 23 | 23 | export type Identifier = z.infer<typeof IdentifierSchema>; |
| 24 | 24 | |
| 25 | 25 | export const LinkSchema = z.object({ |
| 26 | 26 | "note": z.string(), |
| 27 | 27 | "url": z.string(), |
| 28 | -}); | |
| 28 | +}).strict(); | |
| 29 | 29 | export type Link = z.infer<typeof LinkSchema>; |
| 30 | 30 | |
| 31 | 31 | export const TextSchema = z.object({ |
| 32 | 32 | "media_type": z.string(), |
| 33 | 33 | "title": z.string(), |
| 34 | 34 | "url": z.string(), |
| 35 | -}); | |
| 35 | +}).strict(); | |
| 36 | 36 | export type Text = z.infer<typeof TextSchema>; |
| 37 | 37 | |
| 38 | 38 | export const TopLevelElementSchema = z.object({ |
| @@ -44,7 +44,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 44 | 44 | "other_names": z.array(z.any()), |
| 45 | 45 | "superseded_by": z.string(), |
| 46 | 46 | "text": z.array(TextSchema), |
| 47 | -}); | |
| 47 | +}).strict(); | |
| 48 | 48 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 49 | 49 | |
| 50 | 50 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +2 −2test/inputs/json/misc/3659d.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -4,10 +4,10 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TotalPopulationSchema = z.object({ |
| 5 | 5 | "date": z.string(), |
| 6 | 6 | "population": z.number().int(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type TotalPopulation = z.infer<typeof TotalPopulationSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "total_population": z.array(TotalPopulationSchema), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/misc/36d5d.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -11,14 +11,14 @@ export const StatusSchema = z.object({ | ||
| 11 | 11 | "reason": z.string(), |
| 12 | 12 | "trend": z.string(), |
| 13 | 13 | "type": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Status = z.infer<typeof StatusSchema>; |
| 16 | 16 | |
| 17 | 17 | export const MetaSchema = z.object({ |
| 18 | 18 | "credit": z.string(), |
| 19 | 19 | "updated": z.string(), |
| 20 | 20 | "url": z.string(), |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type Meta = z.infer<typeof MetaSchema>; |
| 23 | 23 | |
| 24 | 24 | export const WeatherSchema = z.object({ |
| @@ -27,7 +27,7 @@ export const WeatherSchema = z.object({ | ||
| 27 | 27 | "visibility": z.number(), |
| 28 | 28 | "weather": z.string(), |
| 29 | 29 | "wind": z.string(), |
| 30 | -}); | |
| 30 | +}).strict(); | |
| 31 | 31 | export type Weather = z.infer<typeof WeatherSchema>; |
| 32 | 32 | |
| 33 | 33 | export const TopLevelSchema = z.object({ |
| @@ -39,5 +39,5 @@ export const TopLevelSchema = z.object({ | ||
| 39 | 39 | "state": z.string(), |
| 40 | 40 | "status": StatusSchema, |
| 41 | 41 | "weather": WeatherSchema, |
| 42 | -}); | |
| 42 | +}).strict(); | |
| 43 | 43 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/misc/3a6b3.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -11,14 +11,14 @@ export const StatusSchema = z.object({ | ||
| 11 | 11 | "reason": z.string(), |
| 12 | 12 | "trend": z.string(), |
| 13 | 13 | "type": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Status = z.infer<typeof StatusSchema>; |
| 16 | 16 | |
| 17 | 17 | export const MetaSchema = z.object({ |
| 18 | 18 | "credit": z.string(), |
| 19 | 19 | "updated": z.string(), |
| 20 | 20 | "url": z.string(), |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type Meta = z.infer<typeof MetaSchema>; |
| 23 | 23 | |
| 24 | 24 | export const WeatherSchema = z.object({ |
| @@ -27,7 +27,7 @@ export const WeatherSchema = z.object({ | ||
| 27 | 27 | "visibility": z.number(), |
| 28 | 28 | "weather": z.string(), |
| 29 | 29 | "wind": z.string(), |
| 30 | -}); | |
| 30 | +}).strict(); | |
| 31 | 31 | export type Weather = z.infer<typeof WeatherSchema>; |
| 32 | 32 | |
| 33 | 33 | export const TopLevelSchema = z.object({ |
| @@ -39,5 +39,5 @@ export const TopLevelSchema = z.object({ | ||
| 39 | 39 | "state": z.string(), |
| 40 | 40 | "status": StatusSchema, |
| 41 | 41 | "weather": WeatherSchema, |
| 42 | -}); | |
| 42 | +}).strict(); | |
| 43 | 43 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +5 −5test/inputs/json/misc/3e9a3.json
Mtypescript-zoddefault / TopLevel.ts+5 −5
| @@ -4,7 +4,7 @@ import * as z from "zod"; | ||
| 4 | 4 | export const FootnoteSchema = z.object({ |
| 5 | 5 | "code": z.string().optional(), |
| 6 | 6 | "text": z.string().optional(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Footnote = z.infer<typeof FootnoteSchema>; |
| 9 | 9 | |
| 10 | 10 | export const DatumSchema = z.object({ |
| @@ -13,18 +13,18 @@ export const DatumSchema = z.object({ | ||
| 13 | 13 | "periodName": z.string(), |
| 14 | 14 | "value": z.string(), |
| 15 | 15 | "year": z.string().regex(/^-?\d+$/), |
| 16 | -}); | |
| 16 | +}).strict(); | |
| 17 | 17 | export type Datum = z.infer<typeof DatumSchema>; |
| 18 | 18 | |
| 19 | 19 | export const SeriesSchema = z.object({ |
| 20 | 20 | "data": z.array(DatumSchema), |
| 21 | 21 | "seriesID": z.string(), |
| 22 | -}); | |
| 22 | +}).strict(); | |
| 23 | 23 | export type Series = z.infer<typeof SeriesSchema>; |
| 24 | 24 | |
| 25 | 25 | export const ResultsSchema = z.object({ |
| 26 | 26 | "series": z.array(SeriesSchema), |
| 27 | -}); | |
| 27 | +}).strict(); | |
| 28 | 28 | export type Results = z.infer<typeof ResultsSchema>; |
| 29 | 29 | |
| 30 | 30 | export const TopLevelSchema = z.object({ |
| @@ -32,5 +32,5 @@ export const TopLevelSchema = z.object({ | ||
| 32 | 32 | "responseTime": z.number().int(), |
| 33 | 33 | "Results": ResultsSchema, |
| 34 | 34 | "status": z.string(), |
| 35 | -}); | |
| 35 | +}).strict(); | |
| 36 | 36 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +14 −14test/inputs/json/misc/3f1ce.json
Mtypescript-zoddefault / TopLevel.ts+14 −14
| @@ -9,7 +9,7 @@ export type Text = z.infer<typeof TextSchema>; | ||
| 9 | 9 | export const AstronomySchema = z.object({ |
| 10 | 10 | "sunrise": z.string(), |
| 11 | 11 | "sunset": z.string(), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type Astronomy = z.infer<typeof AstronomySchema>; |
| 14 | 14 | |
| 15 | 15 | export const AtmosphereSchema = z.object({ |
| @@ -17,7 +17,7 @@ export const AtmosphereSchema = z.object({ | ||
| 17 | 17 | "pressure": z.string(), |
| 18 | 18 | "rising": z.string().regex(/^-?\d+$/), |
| 19 | 19 | "visibility": z.string(), |
| 20 | -}); | |
| 20 | +}).strict(); | |
| 21 | 21 | export type Atmosphere = z.infer<typeof AtmosphereSchema>; |
| 22 | 22 | |
| 23 | 23 | export const ImageSchema = z.object({ |
| @@ -26,7 +26,7 @@ export const ImageSchema = z.object({ | ||
| 26 | 26 | "title": z.string(), |
| 27 | 27 | "url": z.string(), |
| 28 | 28 | "width": z.string().regex(/^-?\d+$/), |
| 29 | -}); | |
| 29 | +}).strict(); | |
| 30 | 30 | export type Image = z.infer<typeof ImageSchema>; |
| 31 | 31 | |
| 32 | 32 | export const ConditionSchema = z.object({ |
| @@ -34,7 +34,7 @@ export const ConditionSchema = z.object({ | ||
| 34 | 34 | "date": z.string(), |
| 35 | 35 | "temp": z.string().regex(/^-?\d+$/), |
| 36 | 36 | "text": z.string(), |
| 37 | -}); | |
| 37 | +}).strict(); | |
| 38 | 38 | export type Condition = z.infer<typeof ConditionSchema>; |
| 39 | 39 | |
| 40 | 40 | export const ForecastSchema = z.object({ |
| @@ -44,19 +44,19 @@ export const ForecastSchema = z.object({ | ||
| 44 | 44 | "high": z.string().regex(/^-?\d+$/), |
| 45 | 45 | "low": z.string().regex(/^-?\d+$/), |
| 46 | 46 | "text": TextSchema, |
| 47 | -}); | |
| 47 | +}).strict(); | |
| 48 | 48 | export type Forecast = z.infer<typeof ForecastSchema>; |
| 49 | 49 | |
| 50 | 50 | export const GuidSchema = z.object({ |
| 51 | 51 | "isPermaLink": z.enum(["true", "false"]), |
| 52 | -}); | |
| 52 | +}).strict(); | |
| 53 | 53 | export type Guid = z.infer<typeof GuidSchema>; |
| 54 | 54 | |
| 55 | 55 | export const LocationSchema = z.object({ |
| 56 | 56 | "city": z.string(), |
| 57 | 57 | "country": z.string(), |
| 58 | 58 | "region": z.string(), |
| 59 | -}); | |
| 59 | +}).strict(); | |
| 60 | 60 | export type Location = z.infer<typeof LocationSchema>; |
| 61 | 61 | |
| 62 | 62 | export const UnitsSchema = z.object({ |
| @@ -64,14 +64,14 @@ export const UnitsSchema = z.object({ | ||
| 64 | 64 | "pressure": z.string(), |
| 65 | 65 | "speed": z.string(), |
| 66 | 66 | "temperature": z.string(), |
| 67 | -}); | |
| 67 | +}).strict(); | |
| 68 | 68 | export type Units = z.infer<typeof UnitsSchema>; |
| 69 | 69 | |
| 70 | 70 | export const WindSchema = z.object({ |
| 71 | 71 | "chill": z.string().regex(/^-?\d+$/), |
| 72 | 72 | "direction": z.string().regex(/^-?\d+$/), |
| 73 | 73 | "speed": z.string().regex(/^-?\d+$/), |
| 74 | -}); | |
| 74 | +}).strict(); | |
| 75 | 75 | export type Wind = z.infer<typeof WindSchema>; |
| 76 | 76 | |
| 77 | 77 | export const ItemSchema = z.object({ |
| @@ -84,7 +84,7 @@ export const ItemSchema = z.object({ | ||
| 84 | 84 | "long": z.string(), |
| 85 | 85 | "pubDate": z.string(), |
| 86 | 86 | "title": z.string(), |
| 87 | -}); | |
| 87 | +}).strict(); | |
| 88 | 88 | export type Item = z.infer<typeof ItemSchema>; |
| 89 | 89 | |
| 90 | 90 | export const ChannelSchema = z.object({ |
| @@ -101,12 +101,12 @@ export const ChannelSchema = z.object({ | ||
| 101 | 101 | "ttl": z.string().regex(/^-?\d+$/), |
| 102 | 102 | "units": UnitsSchema, |
| 103 | 103 | "wind": WindSchema, |
| 104 | -}); | |
| 104 | +}).strict(); | |
| 105 | 105 | export type Channel = z.infer<typeof ChannelSchema>; |
| 106 | 106 | |
| 107 | 107 | export const ResultsSchema = z.object({ |
| 108 | 108 | "channel": ChannelSchema, |
| 109 | -}); | |
| 109 | +}).strict(); | |
| 110 | 110 | export type Results = z.infer<typeof ResultsSchema>; |
| 111 | 111 | |
| 112 | 112 | export const QuerySchema = z.object({ |
| @@ -114,10 +114,10 @@ export const QuerySchema = z.object({ | ||
| 114 | 114 | "created": z.coerce.date(), |
| 115 | 115 | "lang": z.string(), |
| 116 | 116 | "results": ResultsSchema, |
| 117 | -}); | |
| 117 | +}).strict(); | |
| 118 | 118 | export type Query = z.infer<typeof QuerySchema>; |
| 119 | 119 | |
| 120 | 120 | export const TopLevelSchema = z.object({ |
| 121 | 121 | "query": QuerySchema, |
| 122 | -}); | |
| 122 | +}).strict(); | |
| 123 | 123 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +13 −13test/inputs/json/misc/421d4.json
Mtypescript-zoddefault / TopLevel.ts+13 −13
| @@ -4,35 +4,35 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TopSchema = z.object({ |
| 5 | 5 | "count": z.number().int(), |
| 6 | 6 | "item": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Top = z.infer<typeof TopSchema>; |
| 9 | 9 | |
| 10 | 10 | export const QuerySchema = z.object({ |
| 11 | -}); | |
| 11 | +}).strict(); | |
| 12 | 12 | export type Query = z.infer<typeof QuerySchema>; |
| 13 | 13 | |
| 14 | 14 | export const GrantSchema = z.object({ |
| 15 | 15 | "flags": z.array(z.string()), |
| 16 | 16 | "inherited": z.boolean(), |
| 17 | 17 | "type": z.string(), |
| 18 | -}); | |
| 18 | +}).strict(); | |
| 19 | 19 | export type Grant = z.infer<typeof GrantSchema>; |
| 20 | 20 | |
| 21 | 21 | export const LicenseSchema = z.object({ |
| 22 | 22 | "name": z.string(), |
| 23 | -}); | |
| 23 | +}).strict(); | |
| 24 | 24 | export type License = z.infer<typeof LicenseSchema>; |
| 25 | 25 | |
| 26 | 26 | export const VisibleSchema = z.object({ |
| 27 | 27 | "table": z.boolean(), |
| 28 | -}); | |
| 28 | +}).strict(); | |
| 29 | 29 | export type Visible = z.infer<typeof VisibleSchema>; |
| 30 | 30 | |
| 31 | 31 | export const OwnerSchema = z.object({ |
| 32 | 32 | "displayName": z.string(), |
| 33 | 33 | "id": z.string(), |
| 34 | 34 | "screenName": z.string(), |
| 35 | -}); | |
| 35 | +}).strict(); | |
| 36 | 36 | export type Owner = z.infer<typeof OwnerSchema>; |
| 37 | 37 | |
| 38 | 38 | export const CachedContentsSchema = z.object({ |
| @@ -43,12 +43,12 @@ export const CachedContentsSchema = z.object({ | ||
| 43 | 43 | "smallest": z.string().optional(), |
| 44 | 44 | "sum": z.string().regex(/^-?\d+$/).optional(), |
| 45 | 45 | "top": z.array(TopSchema).optional(), |
| 46 | -}); | |
| 46 | +}).strict(); | |
| 47 | 47 | export type CachedContents = z.infer<typeof CachedContentsSchema>; |
| 48 | 48 | |
| 49 | 49 | export const RenderTypeConfigSchema = z.object({ |
| 50 | 50 | "visible": VisibleSchema, |
| 51 | -}); | |
| 51 | +}).strict(); | |
| 52 | 52 | export type RenderTypeConfig = z.infer<typeof RenderTypeConfigSchema>; |
| 53 | 53 | |
| 54 | 54 | export const ColumnSchema = z.object({ |
| @@ -63,7 +63,7 @@ export const ColumnSchema = z.object({ | ||
| 63 | 63 | "renderTypeName": z.string(), |
| 64 | 64 | "tableColumnId": z.number().int().optional(), |
| 65 | 65 | "width": z.number().int().optional(), |
| 66 | -}); | |
| 66 | +}).strict(); | |
| 67 | 67 | export type Column = z.infer<typeof ColumnSchema>; |
| 68 | 68 | |
| 69 | 69 | export const MetadataSchema = z.object({ |
| @@ -72,7 +72,7 @@ export const MetadataSchema = z.object({ | ||
| 72 | 72 | "rdfSubject": z.string().regex(/^-?\d+$/), |
| 73 | 73 | "renderTypeConfig": RenderTypeConfigSchema, |
| 74 | 74 | "rowIdentifier": z.string().regex(/^-?\d+$/), |
| 75 | -}); | |
| 75 | +}).strict(); | |
| 76 | 76 | export type Metadata = z.infer<typeof MetadataSchema>; |
| 77 | 77 | |
| 78 | 78 | export const ViewSchema = z.object({ |
| @@ -116,16 +116,16 @@ export const ViewSchema = z.object({ | ||
| 116 | 116 | "viewCount": z.number().int(), |
| 117 | 117 | "viewLastModified": z.number().int(), |
| 118 | 118 | "viewType": z.string(), |
| 119 | -}); | |
| 119 | +}).strict(); | |
| 120 | 120 | export type View = z.infer<typeof ViewSchema>; |
| 121 | 121 | |
| 122 | 122 | export const MetaSchema = z.object({ |
| 123 | 123 | "view": ViewSchema, |
| 124 | -}); | |
| 124 | +}).strict(); | |
| 125 | 125 | export type Meta = z.infer<typeof MetaSchema>; |
| 126 | 126 | |
| 127 | 127 | export const TopLevelSchema = z.object({ |
| 128 | 128 | "data": z.array(z.array(z.union([z.null(), z.number().int(), z.string()]))), |
| 129 | 129 | "meta": MetaSchema, |
| 130 | -}); | |
| 130 | +}).strict(); | |
| 131 | 131 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +10 −10test/inputs/json/misc/437e7.json
Mtypescript-zoddefault / TopLevel.ts+10 −10
| @@ -20,7 +20,7 @@ export const DownsizedSchema = z.object({ | ||
| 20 | 20 | "size": z.string().regex(/^-?\d+$/).optional(), |
| 21 | 21 | "url": z.string(), |
| 22 | 22 | "width": z.string().regex(/^-?\d+$/), |
| 23 | -}); | |
| 23 | +}).strict(); | |
| 24 | 24 | export type Downsized = z.infer<typeof DownsizedSchema>; |
| 25 | 25 | |
| 26 | 26 | export const DownsizedSmallSchema = z.object({ |
| @@ -28,7 +28,7 @@ export const DownsizedSmallSchema = z.object({ | ||
| 28 | 28 | "mp4": z.string(), |
| 29 | 29 | "mp4_size": z.string().regex(/^-?\d+$/), |
| 30 | 30 | "width": z.string().regex(/^-?\d+$/), |
| 31 | -}); | |
| 31 | +}).strict(); | |
| 32 | 32 | export type DownsizedSmall = z.infer<typeof DownsizedSmallSchema>; |
| 33 | 33 | |
| 34 | 34 | export const FixedHeightSchema = z.object({ |
| @@ -41,13 +41,13 @@ export const FixedHeightSchema = z.object({ | ||
| 41 | 41 | "webp": z.string(), |
| 42 | 42 | "webp_size": z.string().regex(/^-?\d+$/), |
| 43 | 43 | "width": z.string().regex(/^-?\d+$/), |
| 44 | -}); | |
| 44 | +}).strict(); | |
| 45 | 45 | export type FixedHeight = z.infer<typeof FixedHeightSchema>; |
| 46 | 46 | |
| 47 | 47 | export const LoopingSchema = z.object({ |
| 48 | 48 | "mp4": z.string(), |
| 49 | 49 | "mp4_size": z.string().regex(/^-?\d+$/), |
| 50 | -}); | |
| 50 | +}).strict(); | |
| 51 | 51 | export type Looping = z.infer<typeof LoopingSchema>; |
| 52 | 52 | |
| 53 | 53 | export const UserSchema = z.object({ |
| @@ -57,21 +57,21 @@ export const UserSchema = z.object({ | ||
| 57 | 57 | "profile_url": z.string(), |
| 58 | 58 | "twitter": z.string(), |
| 59 | 59 | "username": z.string(), |
| 60 | -}); | |
| 60 | +}).strict(); | |
| 61 | 61 | export type User = z.infer<typeof UserSchema>; |
| 62 | 62 | |
| 63 | 63 | export const MetaSchema = z.object({ |
| 64 | 64 | "msg": z.string(), |
| 65 | 65 | "response_id": z.string(), |
| 66 | 66 | "status": z.number().int(), |
| 67 | -}); | |
| 67 | +}).strict(); | |
| 68 | 68 | export type Meta = z.infer<typeof MetaSchema>; |
| 69 | 69 | |
| 70 | 70 | export const PaginationSchema = z.object({ |
| 71 | 71 | "count": z.number().int(), |
| 72 | 72 | "offset": z.number().int(), |
| 73 | 73 | "total_count": z.number().int(), |
| 74 | -}); | |
| 74 | +}).strict(); | |
| 75 | 75 | export type Pagination = z.infer<typeof PaginationSchema>; |
| 76 | 76 | |
| 77 | 77 | export const ImagesSchema = z.object({ |
| @@ -97,7 +97,7 @@ export const ImagesSchema = z.object({ | ||
| 97 | 97 | "preview": DownsizedSmallSchema, |
| 98 | 98 | "preview_gif": DownsizedSchema, |
| 99 | 99 | "preview_webp": DownsizedSchema, |
| 100 | -}); | |
| 100 | +}).strict(); | |
| 101 | 101 | export type Images = z.infer<typeof ImagesSchema>; |
| 102 | 102 | |
| 103 | 103 | export const DatumSchema = z.object({ |
| @@ -119,12 +119,12 @@ export const DatumSchema = z.object({ | ||
| 119 | 119 | "url": z.string(), |
| 120 | 120 | "user": UserSchema.optional(), |
| 121 | 121 | "username": z.string(), |
| 122 | -}); | |
| 122 | +}).strict(); | |
| 123 | 123 | export type Datum = z.infer<typeof DatumSchema>; |
| 124 | 124 | |
| 125 | 125 | export const TopLevelSchema = z.object({ |
| 126 | 126 | "data": z.array(DatumSchema), |
| 127 | 127 | "meta": MetaSchema, |
| 128 | 128 | "pagination": PaginationSchema, |
| 129 | -}); | |
| 129 | +}).strict(); | |
| 130 | 130 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/43970.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -5,7 +5,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 5 | 5 | "ID": z.number().int(), |
| 6 | 6 | "Name": z.string(), |
| 7 | 7 | "Notes": z.string(), |
| 8 | -}); | |
| 8 | +}).strict(); | |
| 9 | 9 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 10 | 10 | |
| 11 | 11 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +1 −1test/inputs/json/misc/43eaf.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -5,5 +5,5 @@ export const TopLevelSchema = z.object({ | ||
| 5 | 5 | "base": z.string(), |
| 6 | 6 | "date": z.string(), |
| 7 | 7 | "rates": z.record(z.string(), z.number()), |
| 8 | -}); | |
| 8 | +}).strict(); | |
| 9 | 9 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +6 −6test/inputs/json/misc/458db.json
Mtypescript-zoddefault / TopLevel.ts+6 −6
| @@ -9,27 +9,27 @@ export type Name = z.infer<typeof NameSchema>; | ||
| 9 | 9 | export const ResponseInfoSchema = z.object({ |
| 10 | 10 | "developerMessage": z.string(), |
| 11 | 11 | "status": z.number().int(), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type ResponseInfo = z.infer<typeof ResponseInfoSchema>; |
| 14 | 14 | |
| 15 | 15 | export const ResultsetSchema = z.object({ |
| 16 | 16 | "count": z.number().int(), |
| 17 | 17 | "page": z.number().int(), |
| 18 | 18 | "pagesize": z.number().int(), |
| 19 | -}); | |
| 19 | +}).strict(); | |
| 20 | 20 | export type Resultset = z.infer<typeof ResultsetSchema>; |
| 21 | 21 | |
| 22 | 22 | export const ComponentSchema = z.object({ |
| 23 | 23 | "name": NameSchema, |
| 24 | 24 | "uuid": z.string().uuid(), |
| 25 | -}); | |
| 25 | +}).strict(); | |
| 26 | 26 | export type Component = z.infer<typeof ComponentSchema>; |
| 27 | 27 | |
| 28 | 28 | export const MetadataSchema = z.object({ |
| 29 | 29 | "executionTime": z.number(), |
| 30 | 30 | "responseInfo": ResponseInfoSchema, |
| 31 | 31 | "resultset": ResultsetSchema, |
| 32 | -}); | |
| 32 | +}).strict(); | |
| 33 | 33 | export type Metadata = z.infer<typeof MetadataSchema>; |
| 34 | 34 | |
| 35 | 35 | export const ResultSchema = z.object({ |
| @@ -46,11 +46,11 @@ export const ResultSchema = z.object({ | ||
| 46 | 46 | "url": z.string(), |
| 47 | 47 | "uuid": z.string().uuid(), |
| 48 | 48 | "vuuid": z.string().uuid(), |
| 49 | -}); | |
| 49 | +}).strict(); | |
| 50 | 50 | export type Result = z.infer<typeof ResultSchema>; |
| 51 | 51 | |
| 52 | 52 | export const TopLevelSchema = z.object({ |
| 53 | 53 | "metadata": MetadataSchema, |
| 54 | 54 | "results": z.array(ResultSchema), |
| 55 | -}); | |
| 55 | +}).strict(); | |
| 56 | 56 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/json/misc/4961a.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -4,10 +4,10 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TotalPopulationSchema = z.object({ |
| 5 | 5 | "date": z.string(), |
| 6 | 6 | "population": z.number().int(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type TotalPopulation = z.infer<typeof TotalPopulationSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "total_population": z.array(TotalPopulationSchema), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/json/misc/4a0d7.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -4,10 +4,10 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TotalPopulationSchema = z.object({ |
| 5 | 5 | "date": z.string(), |
| 6 | 6 | "population": z.number().int(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type TotalPopulation = z.infer<typeof TotalPopulationSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "total_population": z.array(TotalPopulationSchema), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +6 −6test/inputs/json/misc/4a455.json
Mtypescript-zoddefault / TopLevel.ts+6 −6
| @@ -20,13 +20,13 @@ export type FeatureType = z.infer<typeof FeatureTypeSchema>; | ||
| 20 | 20 | |
| 21 | 21 | export const CrsPropertiesSchema = z.object({ |
| 22 | 22 | "name": z.string(), |
| 23 | -}); | |
| 23 | +}).strict(); | |
| 24 | 24 | export type CrsProperties = z.infer<typeof CrsPropertiesSchema>; |
| 25 | 25 | |
| 26 | 26 | export const GeometrySchema = z.object({ |
| 27 | 27 | "coordinates": z.array(z.array(z.number())), |
| 28 | 28 | "type": GeometryTypeSchema, |
| 29 | -}); | |
| 29 | +}).strict(); | |
| 30 | 30 | export type Geometry = z.infer<typeof GeometrySchema>; |
| 31 | 31 | |
| 32 | 32 | export const FeaturePropertiesSchema = z.object({ |
| @@ -36,13 +36,13 @@ export const FeaturePropertiesSchema = z.object({ | ||
| 36 | 36 | "siteurl": z.string(), |
| 37 | 37 | "streetaddress": z.string(), |
| 38 | 38 | "twitteraccount": z.string(), |
| 39 | -}); | |
| 39 | +}).strict(); | |
| 40 | 40 | export type FeatureProperties = z.infer<typeof FeaturePropertiesSchema>; |
| 41 | 41 | |
| 42 | 42 | export const CrsSchema = z.object({ |
| 43 | 43 | "properties": CrsPropertiesSchema, |
| 44 | 44 | "type": z.string(), |
| 45 | -}); | |
| 45 | +}).strict(); | |
| 46 | 46 | export type Crs = z.infer<typeof CrsSchema>; |
| 47 | 47 | |
| 48 | 48 | export const FeatureSchema = z.object({ |
| @@ -51,7 +51,7 @@ export const FeatureSchema = z.object({ | ||
| 51 | 51 | "id": z.string(), |
| 52 | 52 | "properties": FeaturePropertiesSchema, |
| 53 | 53 | "type": FeatureTypeSchema, |
| 54 | -}); | |
| 54 | +}).strict(); | |
| 55 | 55 | export type Feature = z.infer<typeof FeatureSchema>; |
| 56 | 56 | |
| 57 | 57 | export const TopLevelSchema = z.object({ |
| @@ -59,5 +59,5 @@ export const TopLevelSchema = z.object({ | ||
| 59 | 59 | "features": z.array(FeatureSchema), |
| 60 | 60 | "totalFeatures": z.number().int(), |
| 61 | 61 | "type": z.string(), |
| 62 | -}); | |
| 62 | +}).strict(); | |
| 63 | 63 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +14 −14test/inputs/json/misc/4c547.json
Mtypescript-zoddefault / TopLevel.ts+14 −14
| @@ -4,7 +4,7 @@ import * as z from "zod"; | ||
| 4 | 4 | export const AstronomySchema = z.object({ |
| 5 | 5 | "sunrise": z.string(), |
| 6 | 6 | "sunset": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Astronomy = z.infer<typeof AstronomySchema>; |
| 9 | 9 | |
| 10 | 10 | export const AtmosphereSchema = z.object({ |
| @@ -12,7 +12,7 @@ export const AtmosphereSchema = z.object({ | ||
| 12 | 12 | "pressure": z.string(), |
| 13 | 13 | "rising": z.string().regex(/^-?\d+$/), |
| 14 | 14 | "visibility": z.string(), |
| 15 | -}); | |
| 15 | +}).strict(); | |
| 16 | 16 | export type Atmosphere = z.infer<typeof AtmosphereSchema>; |
| 17 | 17 | |
| 18 | 18 | export const ImageSchema = z.object({ |
| @@ -21,7 +21,7 @@ export const ImageSchema = z.object({ | ||
| 21 | 21 | "title": z.string(), |
| 22 | 22 | "url": z.string(), |
| 23 | 23 | "width": z.string().regex(/^-?\d+$/), |
| 24 | -}); | |
| 24 | +}).strict(); | |
| 25 | 25 | export type Image = z.infer<typeof ImageSchema>; |
| 26 | 26 | |
| 27 | 27 | export const ConditionSchema = z.object({ |
| @@ -29,7 +29,7 @@ export const ConditionSchema = z.object({ | ||
| 29 | 29 | "date": z.string(), |
| 30 | 30 | "temp": z.string().regex(/^-?\d+$/), |
| 31 | 31 | "text": z.string(), |
| 32 | -}); | |
| 32 | +}).strict(); | |
| 33 | 33 | export type Condition = z.infer<typeof ConditionSchema>; |
| 34 | 34 | |
| 35 | 35 | export const ForecastSchema = z.object({ |
| @@ -39,19 +39,19 @@ export const ForecastSchema = z.object({ | ||
| 39 | 39 | "high": z.string().regex(/^-?\d+$/), |
| 40 | 40 | "low": z.string().regex(/^-?\d+$/), |
| 41 | 41 | "text": z.string(), |
| 42 | -}); | |
| 42 | +}).strict(); | |
| 43 | 43 | export type Forecast = z.infer<typeof ForecastSchema>; |
| 44 | 44 | |
| 45 | 45 | export const GuidSchema = z.object({ |
| 46 | 46 | "isPermaLink": z.enum(["true", "false"]), |
| 47 | -}); | |
| 47 | +}).strict(); | |
| 48 | 48 | export type Guid = z.infer<typeof GuidSchema>; |
| 49 | 49 | |
| 50 | 50 | export const LocationSchema = z.object({ |
| 51 | 51 | "city": z.string(), |
| 52 | 52 | "country": z.string(), |
| 53 | 53 | "region": z.string(), |
| 54 | -}); | |
| 54 | +}).strict(); | |
| 55 | 55 | export type Location = z.infer<typeof LocationSchema>; |
| 56 | 56 | |
| 57 | 57 | export const UnitsSchema = z.object({ |
| @@ -59,14 +59,14 @@ export const UnitsSchema = z.object({ | ||
| 59 | 59 | "pressure": z.string(), |
| 60 | 60 | "speed": z.string(), |
| 61 | 61 | "temperature": z.string(), |
| 62 | -}); | |
| 62 | +}).strict(); | |
| 63 | 63 | export type Units = z.infer<typeof UnitsSchema>; |
| 64 | 64 | |
| 65 | 65 | export const WindSchema = z.object({ |
| 66 | 66 | "chill": z.string().regex(/^-?\d+$/), |
| 67 | 67 | "direction": z.string().regex(/^-?\d+$/), |
| 68 | 68 | "speed": z.string().regex(/^-?\d+$/), |
| 69 | -}); | |
| 69 | +}).strict(); | |
| 70 | 70 | export type Wind = z.infer<typeof WindSchema>; |
| 71 | 71 | |
| 72 | 72 | export const ItemSchema = z.object({ |
| @@ -79,7 +79,7 @@ export const ItemSchema = z.object({ | ||
| 79 | 79 | "long": z.string(), |
| 80 | 80 | "pubDate": z.string(), |
| 81 | 81 | "title": z.string(), |
| 82 | -}); | |
| 82 | +}).strict(); | |
| 83 | 83 | export type Item = z.infer<typeof ItemSchema>; |
| 84 | 84 | |
| 85 | 85 | export const ChannelSchema = z.object({ |
| @@ -96,12 +96,12 @@ export const ChannelSchema = z.object({ | ||
| 96 | 96 | "ttl": z.string().regex(/^-?\d+$/), |
| 97 | 97 | "units": UnitsSchema, |
| 98 | 98 | "wind": WindSchema, |
| 99 | -}); | |
| 99 | +}).strict(); | |
| 100 | 100 | export type Channel = z.infer<typeof ChannelSchema>; |
| 101 | 101 | |
| 102 | 102 | export const ResultsSchema = z.object({ |
| 103 | 103 | "channel": ChannelSchema, |
| 104 | -}); | |
| 104 | +}).strict(); | |
| 105 | 105 | export type Results = z.infer<typeof ResultsSchema>; |
| 106 | 106 | |
| 107 | 107 | export const QuerySchema = z.object({ |
| @@ -109,10 +109,10 @@ export const QuerySchema = z.object({ | ||
| 109 | 109 | "created": z.coerce.date(), |
| 110 | 110 | "lang": z.string(), |
| 111 | 111 | "results": ResultsSchema, |
| 112 | -}); | |
| 112 | +}).strict(); | |
| 113 | 113 | export type Query = z.infer<typeof QuerySchema>; |
| 114 | 114 | |
| 115 | 115 | export const TopLevelSchema = z.object({ |
| 116 | 116 | "query": QuerySchema, |
| 117 | -}); | |
| 117 | +}).strict(); | |
| 118 | 118 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +11 −11test/inputs/json/misc/4d6fb.json
Mtypescript-zoddefault / TopLevel.ts+11 −11
| @@ -51,7 +51,7 @@ export const OembedSchema = z.object({ | ||
| 51 | 51 | "type": z.string(), |
| 52 | 52 | "version": z.string(), |
| 53 | 53 | "width": z.number().int(), |
| 54 | -}); | |
| 54 | +}).strict(); | |
| 55 | 55 | export type Oembed = z.infer<typeof OembedSchema>; |
| 56 | 56 | |
| 57 | 57 | export const MediaEmbedSchema = z.object({ |
| @@ -59,24 +59,24 @@ export const MediaEmbedSchema = z.object({ | ||
| 59 | 59 | "height": z.number().int().optional(), |
| 60 | 60 | "scrolling": z.boolean().optional(), |
| 61 | 61 | "width": z.number().int().optional(), |
| 62 | -}); | |
| 62 | +}).strict(); | |
| 63 | 63 | export type MediaEmbed = z.infer<typeof MediaEmbedSchema>; |
| 64 | 64 | |
| 65 | 65 | export const SourceSchema = z.object({ |
| 66 | 66 | "height": z.number().int(), |
| 67 | 67 | "url": z.string(), |
| 68 | 68 | "width": z.number().int(), |
| 69 | -}); | |
| 69 | +}).strict(); | |
| 70 | 70 | export type Source = z.infer<typeof SourceSchema>; |
| 71 | 71 | |
| 72 | 72 | export const VariantsSchema = z.object({ |
| 73 | -}); | |
| 73 | +}).strict(); | |
| 74 | 74 | export type Variants = z.infer<typeof VariantsSchema>; |
| 75 | 75 | |
| 76 | 76 | export const MediaSchema = z.object({ |
| 77 | 77 | "oembed": OembedSchema, |
| 78 | 78 | "type": z.string(), |
| 79 | -}); | |
| 79 | +}).strict(); | |
| 80 | 80 | export type Media = z.infer<typeof MediaSchema>; |
| 81 | 81 | |
| 82 | 82 | export const ImageSchema = z.object({ |
| @@ -84,13 +84,13 @@ export const ImageSchema = z.object({ | ||
| 84 | 84 | "resolutions": z.array(SourceSchema), |
| 85 | 85 | "source": SourceSchema, |
| 86 | 86 | "variants": VariantsSchema, |
| 87 | -}); | |
| 87 | +}).strict(); | |
| 88 | 88 | export type Image = z.infer<typeof ImageSchema>; |
| 89 | 89 | |
| 90 | 90 | export const PreviewSchema = z.object({ |
| 91 | 91 | "enabled": z.boolean(), |
| 92 | 92 | "images": z.array(ImageSchema), |
| 93 | -}); | |
| 93 | +}).strict(); | |
| 94 | 94 | export type Preview = z.infer<typeof PreviewSchema>; |
| 95 | 95 | |
| 96 | 96 | export const ChildDataSchema = z.object({ |
| @@ -158,13 +158,13 @@ export const ChildDataSchema = z.object({ | ||
| 158 | 158 | "user_reports": z.array(z.any()), |
| 159 | 159 | "view_count": z.null(), |
| 160 | 160 | "visited": z.boolean(), |
| 161 | -}); | |
| 161 | +}).strict(); | |
| 162 | 162 | export type ChildData = z.infer<typeof ChildDataSchema>; |
| 163 | 163 | |
| 164 | 164 | export const ChildSchema = z.object({ |
| 165 | 165 | "data": ChildDataSchema, |
| 166 | 166 | "kind": KindSchema, |
| 167 | -}); | |
| 167 | +}).strict(); | |
| 168 | 168 | export type Child = z.infer<typeof ChildSchema>; |
| 169 | 169 | |
| 170 | 170 | export const TopLevelDataSchema = z.object({ |
| @@ -172,11 +172,11 @@ export const TopLevelDataSchema = z.object({ | ||
| 172 | 172 | "before": z.null(), |
| 173 | 173 | "children": z.array(ChildSchema), |
| 174 | 174 | "modhash": z.string(), |
| 175 | -}); | |
| 175 | +}).strict(); | |
| 176 | 176 | export type TopLevelData = z.infer<typeof TopLevelDataSchema>; |
| 177 | 177 | |
| 178 | 178 | export const TopLevelSchema = z.object({ |
| 179 | 179 | "data": TopLevelDataSchema, |
| 180 | 180 | "kind": z.string(), |
| 181 | -}); | |
| 181 | +}).strict(); | |
| 182 | 182 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/json/misc/4e336.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -4,10 +4,10 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TotalPopulationSchema = z.object({ |
| 5 | 5 | "date": z.string(), |
| 6 | 6 | "population": z.number().int(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type TotalPopulation = z.infer<typeof TotalPopulationSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "total_population": z.array(TotalPopulationSchema), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +3 −3test/inputs/json/misc/54147.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -2,7 +2,7 @@ import * as z from "zod"; | ||
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | export const ArgsSchema = z.object({ |
| 5 | -}); | |
| 5 | +}).strict(); | |
| 6 | 6 | export type Args = z.infer<typeof ArgsSchema>; |
| 7 | 7 | |
| 8 | 8 | export const HeadersSchema = z.object({ |
| @@ -10,7 +10,7 @@ export const HeadersSchema = z.object({ | ||
| 10 | 10 | "Connection": z.string(), |
| 11 | 11 | "Host": z.string(), |
| 12 | 12 | "User-Agent": z.string(), |
| 13 | -}); | |
| 13 | +}).strict(); | |
| 14 | 14 | export type Headers = z.infer<typeof HeadersSchema>; |
| 15 | 15 | |
| 16 | 16 | export const TopLevelSchema = z.object({ |
| @@ -21,5 +21,5 @@ export const TopLevelSchema = z.object({ | ||
| 21 | 21 | "headers": HeadersSchema, |
| 22 | 22 | "origin": z.string(), |
| 23 | 23 | "url": z.string(), |
| 24 | -}); | |
| 24 | +}).strict(); | |
| 25 | 25 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +3 −3test/inputs/json/misc/54d32.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -8,7 +8,7 @@ export const StatusSchema = z.enum([ | ||
| 8 | 8 | export type Status = z.infer<typeof StatusSchema>; |
| 9 | 9 | |
| 10 | 10 | export const FacetsSchema = z.object({ |
| 11 | -}); | |
| 11 | +}).strict(); | |
| 12 | 12 | export type Facets = z.infer<typeof FacetsSchema>; |
| 13 | 13 | |
| 14 | 14 | export const ResultSchema = z.object({ |
| @@ -18,7 +18,7 @@ export const ResultSchema = z.object({ | ||
| 18 | 18 | "representative_id": z.string(), |
| 19 | 19 | "status": StatusSchema, |
| 20 | 20 | "updated_at": z.coerce.date(), |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type Result = z.infer<typeof ResultSchema>; |
| 23 | 23 | |
| 24 | 24 | export const TopLevelSchema = z.object({ |
| @@ -29,5 +29,5 @@ export const TopLevelSchema = z.object({ | ||
| 29 | 29 | "offset": z.number().int(), |
| 30 | 30 | "previous": z.boolean(), |
| 31 | 31 | "results": z.array(ResultSchema), |
| 32 | -}); | |
| 32 | +}).strict(); | |
| 33 | 33 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +5 −5test/inputs/json/misc/570ec.json
Mtypescript-zoddefault / TopLevel.ts+5 −5
| @@ -11,26 +11,26 @@ export type Scheme = z.infer<typeof SchemeSchema>; | ||
| 11 | 11 | export const IdentifierSchema = z.object({ |
| 12 | 12 | "identifier": z.string(), |
| 13 | 13 | "scheme": SchemeSchema, |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Identifier = z.infer<typeof IdentifierSchema>; |
| 16 | 16 | |
| 17 | 17 | export const LinkSchema = z.object({ |
| 18 | 18 | "note": z.string(), |
| 19 | 19 | "url": z.string(), |
| 20 | -}); | |
| 20 | +}).strict(); | |
| 21 | 21 | export type Link = z.infer<typeof LinkSchema>; |
| 22 | 22 | |
| 23 | 23 | export const OtherNameSchema = z.object({ |
| 24 | 24 | "name": z.string(), |
| 25 | 25 | "note": z.union([z.null(), z.string()]), |
| 26 | -}); | |
| 26 | +}).strict(); | |
| 27 | 27 | export type OtherName = z.infer<typeof OtherNameSchema>; |
| 28 | 28 | |
| 29 | 29 | export const TextSchema = z.object({ |
| 30 | 30 | "media_type": z.string(), |
| 31 | 31 | "title": z.string(), |
| 32 | 32 | "url": z.string(), |
| 33 | -}); | |
| 33 | +}).strict(); | |
| 34 | 34 | export type Text = z.infer<typeof TextSchema>; |
| 35 | 35 | |
| 36 | 36 | export const TopLevelElementSchema = z.object({ |
| @@ -42,7 +42,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 42 | 42 | "other_names": z.array(OtherNameSchema), |
| 43 | 43 | "superseded_by": z.null(), |
| 44 | 44 | "text": z.array(TextSchema), |
| 45 | -}); | |
| 45 | +}).strict(); | |
| 46 | 46 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 47 | 47 | |
| 48 | 48 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +4 −4test/inputs/json/misc/5dd0d.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -11,14 +11,14 @@ export const StatusSchema = z.object({ | ||
| 11 | 11 | "reason": z.string(), |
| 12 | 12 | "trend": z.string(), |
| 13 | 13 | "type": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Status = z.infer<typeof StatusSchema>; |
| 16 | 16 | |
| 17 | 17 | export const MetaSchema = z.object({ |
| 18 | 18 | "credit": z.string(), |
| 19 | 19 | "updated": z.string(), |
| 20 | 20 | "url": z.string(), |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type Meta = z.infer<typeof MetaSchema>; |
| 23 | 23 | |
| 24 | 24 | export const WeatherSchema = z.object({ |
| @@ -27,7 +27,7 @@ export const WeatherSchema = z.object({ | ||
| 27 | 27 | "visibility": z.number(), |
| 28 | 28 | "weather": z.string(), |
| 29 | 29 | "wind": z.string(), |
| 30 | -}); | |
| 30 | +}).strict(); | |
| 31 | 31 | export type Weather = z.infer<typeof WeatherSchema>; |
| 32 | 32 | |
| 33 | 33 | export const TopLevelSchema = z.object({ |
| @@ -39,5 +39,5 @@ export const TopLevelSchema = z.object({ | ||
| 39 | 39 | "state": z.string(), |
| 40 | 40 | "status": StatusSchema, |
| 41 | 41 | "weather": WeatherSchema, |
| 42 | -}); | |
| 42 | +}).strict(); | |
| 43 | 43 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/5eae5.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -6,7 +6,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 6 | 6 | "ID": z.number().int(), |
| 7 | 7 | "Sponsor": z.string(), |
| 8 | 8 | "Title": z.string(), |
| 9 | -}); | |
| 9 | +}).strict(); | |
| 10 | 10 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 11 | 11 | |
| 12 | 12 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +4 −4test/inputs/json/misc/5eb20.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -11,14 +11,14 @@ export const StatusSchema = z.object({ | ||
| 11 | 11 | "reason": z.string(), |
| 12 | 12 | "trend": z.string(), |
| 13 | 13 | "type": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Status = z.infer<typeof StatusSchema>; |
| 16 | 16 | |
| 17 | 17 | export const MetaSchema = z.object({ |
| 18 | 18 | "credit": z.string(), |
| 19 | 19 | "updated": z.string(), |
| 20 | 20 | "url": z.string(), |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type Meta = z.infer<typeof MetaSchema>; |
| 23 | 23 | |
| 24 | 24 | export const WeatherSchema = z.object({ |
| @@ -27,7 +27,7 @@ export const WeatherSchema = z.object({ | ||
| 27 | 27 | "visibility": z.number(), |
| 28 | 28 | "weather": z.string(), |
| 29 | 29 | "wind": z.string(), |
| 30 | -}); | |
| 30 | +}).strict(); | |
| 31 | 31 | export type Weather = z.infer<typeof WeatherSchema>; |
| 32 | 32 | |
| 33 | 33 | export const TopLevelSchema = z.object({ |
| @@ -39,5 +39,5 @@ export const TopLevelSchema = z.object({ | ||
| 39 | 39 | "state": z.string(), |
| 40 | 40 | "status": StatusSchema, |
| 41 | 41 | "weather": WeatherSchema, |
| 42 | -}); | |
| 42 | +}).strict(); | |
| 43 | 43 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/5f3a1.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -5,5 +5,5 @@ export const TopLevelSchema = z.object({ | ||
| 5 | 5 | "base": z.string(), |
| 6 | 6 | "date": z.string(), |
| 7 | 7 | "rates": z.record(z.string(), z.number()), |
| 8 | -}); | |
| 8 | +}).strict(); | |
| 9 | 9 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +24 −24test/inputs/json/misc/5f7fe.json
Mtypescript-zoddefault / TopLevel.ts+24 −24
| @@ -11,20 +11,20 @@ export type TypeName = z.infer<typeof TypeNameSchema>; | ||
| 11 | 11 | export const TopSchema = z.object({ |
| 12 | 12 | "count": z.number().int(), |
| 13 | 13 | "item": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Top = z.infer<typeof TopSchema>; |
| 16 | 16 | |
| 17 | 17 | export const FormatSchema = z.object({ |
| 18 | 18 | "align": z.string().optional(), |
| 19 | 19 | "view": z.string().optional(), |
| 20 | -}); | |
| 20 | +}).strict(); | |
| 21 | 21 | export type Format = z.infer<typeof FormatSchema>; |
| 22 | 22 | |
| 23 | 23 | export const GrantSchema = z.object({ |
| 24 | 24 | "flags": z.array(z.string()), |
| 25 | 25 | "inherited": z.boolean(), |
| 26 | 26 | "type": z.string(), |
| 27 | -}); | |
| 27 | +}).strict(); | |
| 28 | 28 | export type Grant = z.infer<typeof GrantSchema>; |
| 29 | 29 | |
| 30 | 30 | export const AttachmentSchema = z.object({ |
| @@ -32,25 +32,25 @@ export const AttachmentSchema = z.object({ | ||
| 32 | 32 | "blobId": z.string(), |
| 33 | 33 | "filename": z.string(), |
| 34 | 34 | "name": z.string(), |
| 35 | -}); | |
| 35 | +}).strict(); | |
| 36 | 36 | export type Attachment = z.infer<typeof AttachmentSchema>; |
| 37 | 37 | |
| 38 | 38 | export const AdditionalResourcesSchema = z.object({ |
| 39 | 39 | "See Also ": z.string(), |
| 40 | 40 | "See Also": z.string(), |
| 41 | -}); | |
| 41 | +}).strict(); | |
| 42 | 42 | export type AdditionalResources = z.infer<typeof AdditionalResourcesSchema>; |
| 43 | 43 | |
| 44 | 44 | export const CommonCoreSchema = z.object({ |
| 45 | 45 | "Contact Email": z.string(), |
| 46 | 46 | "Contact Name": z.string(), |
| 47 | 47 | "Publisher": z.string(), |
| 48 | -}); | |
| 48 | +}).strict(); | |
| 49 | 49 | export type CommonCore = z.infer<typeof CommonCoreSchema>; |
| 50 | 50 | |
| 51 | 51 | export const DatasetInformationSchema = z.object({ |
| 52 | 52 | "Agency": z.string(), |
| 53 | -}); | |
| 53 | +}).strict(); | |
| 54 | 54 | export type DatasetInformation = z.infer<typeof DatasetInformationSchema>; |
| 55 | 55 | |
| 56 | 56 | export const DatasetSummarySchema = z.object({ |
| @@ -63,23 +63,23 @@ export const DatasetSummarySchema = z.object({ | ||
| 63 | 63 | "Posting Frequency": z.string(), |
| 64 | 64 | "Time Period": z.string(), |
| 65 | 65 | "Units": z.string(), |
| 66 | -}); | |
| 66 | +}).strict(); | |
| 67 | 67 | export type DatasetSummary = z.infer<typeof DatasetSummarySchema>; |
| 68 | 68 | |
| 69 | 69 | export const NotesSchema = z.object({ |
| 70 | 70 | "Notes": z.string(), |
| 71 | -}); | |
| 71 | +}).strict(); | |
| 72 | 72 | export type Notes = z.infer<typeof NotesSchema>; |
| 73 | 73 | |
| 74 | 74 | export const OrderSchema = z.object({ |
| 75 | 75 | "ascending": z.boolean(), |
| 76 | 76 | "columnFieldName": z.string(), |
| 77 | -}); | |
| 77 | +}).strict(); | |
| 78 | 78 | export type Order = z.infer<typeof OrderSchema>; |
| 79 | 79 | |
| 80 | 80 | export const VisibleSchema = z.object({ |
| 81 | 81 | "table": z.boolean(), |
| 82 | -}); | |
| 82 | +}).strict(); | |
| 83 | 83 | export type Visible = z.infer<typeof VisibleSchema>; |
| 84 | 84 | |
| 85 | 85 | export const OwnerSchema = z.object({ |
| @@ -91,13 +91,13 @@ export const OwnerSchema = z.object({ | ||
| 91 | 91 | "rights": z.array(z.string()), |
| 92 | 92 | "roleName": z.string(), |
| 93 | 93 | "screenName": z.string(), |
| 94 | -}); | |
| 94 | +}).strict(); | |
| 95 | 95 | export type Owner = z.infer<typeof OwnerSchema>; |
| 96 | 96 | |
| 97 | 97 | export const ExpressionSchema = z.object({ |
| 98 | 98 | "columnId": z.number().int(), |
| 99 | 99 | "type": z.string(), |
| 100 | -}); | |
| 100 | +}).strict(); | |
| 101 | 101 | export type Expression = z.infer<typeof ExpressionSchema>; |
| 102 | 102 | |
| 103 | 103 | export const CachedContentsSchema = z.object({ |
| @@ -106,7 +106,7 @@ export const CachedContentsSchema = z.object({ | ||
| 106 | 106 | "null": z.number().int(), |
| 107 | 107 | "smallest": z.string(), |
| 108 | 108 | "top": z.array(TopSchema), |
| 109 | -}); | |
| 109 | +}).strict(); | |
| 110 | 110 | export type CachedContents = z.infer<typeof CachedContentsSchema>; |
| 111 | 111 | |
| 112 | 112 | export const CustomFieldsSchema = z.object({ |
| @@ -115,23 +115,23 @@ export const CustomFieldsSchema = z.object({ | ||
| 115 | 115 | "Dataset Information": DatasetInformationSchema, |
| 116 | 116 | "Dataset Summary": DatasetSummarySchema, |
| 117 | 117 | "Notes": NotesSchema, |
| 118 | -}); | |
| 118 | +}).strict(); | |
| 119 | 119 | export type CustomFields = z.infer<typeof CustomFieldsSchema>; |
| 120 | 120 | |
| 121 | 121 | export const JsonQuerySchema = z.object({ |
| 122 | 122 | "order": z.array(OrderSchema), |
| 123 | -}); | |
| 123 | +}).strict(); | |
| 124 | 124 | export type JsonQuery = z.infer<typeof JsonQuerySchema>; |
| 125 | 125 | |
| 126 | 126 | export const RenderTypeConfigSchema = z.object({ |
| 127 | 127 | "visible": VisibleSchema, |
| 128 | -}); | |
| 128 | +}).strict(); | |
| 129 | 129 | export type RenderTypeConfig = z.infer<typeof RenderTypeConfigSchema>; |
| 130 | 130 | |
| 131 | 131 | export const OrderBySchema = z.object({ |
| 132 | 132 | "ascending": z.boolean(), |
| 133 | 133 | "expression": ExpressionSchema, |
| 134 | -}); | |
| 134 | +}).strict(); | |
| 135 | 135 | export type OrderBy = z.infer<typeof OrderBySchema>; |
| 136 | 136 | |
| 137 | 137 | export const ColumnSchema = z.object({ |
| @@ -146,7 +146,7 @@ export const ColumnSchema = z.object({ | ||
| 146 | 146 | "renderTypeName": TypeNameSchema, |
| 147 | 147 | "tableColumnId": z.number().int().optional(), |
| 148 | 148 | "width": z.number().int().optional(), |
| 149 | -}); | |
| 149 | +}).strict(); | |
| 150 | 150 | export type Column = z.infer<typeof ColumnSchema>; |
| 151 | 151 | |
| 152 | 152 | export const MetadataSchema = z.object({ |
| @@ -156,12 +156,12 @@ export const MetadataSchema = z.object({ | ||
| 156 | 156 | "jsonQuery": JsonQuerySchema, |
| 157 | 157 | "rdfSubject": z.string().regex(/^-?\d+$/), |
| 158 | 158 | "renderTypeConfig": RenderTypeConfigSchema, |
| 159 | -}); | |
| 159 | +}).strict(); | |
| 160 | 160 | export type Metadata = z.infer<typeof MetadataSchema>; |
| 161 | 161 | |
| 162 | 162 | export const QuerySchema = z.object({ |
| 163 | 163 | "orderBys": z.array(OrderBySchema), |
| 164 | -}); | |
| 164 | +}).strict(); | |
| 165 | 165 | export type Query = z.infer<typeof QuerySchema>; |
| 166 | 166 | |
| 167 | 167 | export const ViewSchema = z.object({ |
| @@ -203,16 +203,16 @@ export const ViewSchema = z.object({ | ||
| 203 | 203 | "viewCount": z.number().int(), |
| 204 | 204 | "viewLastModified": z.number().int(), |
| 205 | 205 | "viewType": z.string(), |
| 206 | -}); | |
| 206 | +}).strict(); | |
| 207 | 207 | export type View = z.infer<typeof ViewSchema>; |
| 208 | 208 | |
| 209 | 209 | export const MetaSchema = z.object({ |
| 210 | 210 | "view": ViewSchema, |
| 211 | -}); | |
| 211 | +}).strict(); | |
| 212 | 212 | export type Meta = z.infer<typeof MetaSchema>; |
| 213 | 213 | |
| 214 | 214 | export const TopLevelSchema = z.object({ |
| 215 | 215 | "data": z.array(z.array(z.union([z.null(), z.number().int(), z.string()]))), |
| 216 | 216 | "meta": MetaSchema, |
| 217 | -}); | |
| 217 | +}).strict(); | |
| 218 | 218 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +24 −24test/inputs/json/misc/617e8.json
Mtypescript-zoddefault / TopLevel.ts+24 −24
| @@ -11,20 +11,20 @@ export type TypeName = z.infer<typeof TypeNameSchema>; | ||
| 11 | 11 | export const TopSchema = z.object({ |
| 12 | 12 | "count": z.number().int(), |
| 13 | 13 | "item": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Top = z.infer<typeof TopSchema>; |
| 16 | 16 | |
| 17 | 17 | export const FormatSchema = z.object({ |
| 18 | 18 | "align": z.string().optional(), |
| 19 | 19 | "view": z.string().optional(), |
| 20 | -}); | |
| 20 | +}).strict(); | |
| 21 | 21 | export type Format = z.infer<typeof FormatSchema>; |
| 22 | 22 | |
| 23 | 23 | export const GrantSchema = z.object({ |
| 24 | 24 | "flags": z.array(z.string()), |
| 25 | 25 | "inherited": z.boolean(), |
| 26 | 26 | "type": z.string(), |
| 27 | -}); | |
| 27 | +}).strict(); | |
| 28 | 28 | export type Grant = z.infer<typeof GrantSchema>; |
| 29 | 29 | |
| 30 | 30 | export const AttachmentSchema = z.object({ |
| @@ -32,24 +32,24 @@ export const AttachmentSchema = z.object({ | ||
| 32 | 32 | "blobId": z.string(), |
| 33 | 33 | "filename": z.string(), |
| 34 | 34 | "name": z.string(), |
| 35 | -}); | |
| 35 | +}).strict(); | |
| 36 | 36 | export type Attachment = z.infer<typeof AttachmentSchema>; |
| 37 | 37 | |
| 38 | 38 | export const AdditionalResourcesSchema = z.object({ |
| 39 | 39 | "See Also": z.string(), |
| 40 | -}); | |
| 40 | +}).strict(); | |
| 41 | 41 | export type AdditionalResources = z.infer<typeof AdditionalResourcesSchema>; |
| 42 | 42 | |
| 43 | 43 | export const CommonCoreSchema = z.object({ |
| 44 | 44 | "Contact Email": z.string(), |
| 45 | 45 | "Contact Name": z.string(), |
| 46 | 46 | "Publisher": z.string(), |
| 47 | -}); | |
| 47 | +}).strict(); | |
| 48 | 48 | export type CommonCore = z.infer<typeof CommonCoreSchema>; |
| 49 | 49 | |
| 50 | 50 | export const DatasetInformationSchema = z.object({ |
| 51 | 51 | "Agency": z.string(), |
| 52 | -}); | |
| 52 | +}).strict(); | |
| 53 | 53 | export type DatasetInformation = z.infer<typeof DatasetInformationSchema>; |
| 54 | 54 | |
| 55 | 55 | export const DatasetSummarySchema = z.object({ |
| @@ -61,23 +61,23 @@ export const DatasetSummarySchema = z.object({ | ||
| 61 | 61 | "Organization": z.string(), |
| 62 | 62 | "Posting Frequency": z.string(), |
| 63 | 63 | "Time Period": z.string(), |
| 64 | -}); | |
| 64 | +}).strict(); | |
| 65 | 65 | export type DatasetSummary = z.infer<typeof DatasetSummarySchema>; |
| 66 | 66 | |
| 67 | 67 | export const NotesSchema = z.object({ |
| 68 | 68 | "Notes": z.string(), |
| 69 | -}); | |
| 69 | +}).strict(); | |
| 70 | 70 | export type Notes = z.infer<typeof NotesSchema>; |
| 71 | 71 | |
| 72 | 72 | export const OrderSchema = z.object({ |
| 73 | 73 | "ascending": z.boolean(), |
| 74 | 74 | "columnFieldName": z.string(), |
| 75 | -}); | |
| 75 | +}).strict(); | |
| 76 | 76 | export type Order = z.infer<typeof OrderSchema>; |
| 77 | 77 | |
| 78 | 78 | export const VisibleSchema = z.object({ |
| 79 | 79 | "table": z.boolean(), |
| 80 | -}); | |
| 80 | +}).strict(); | |
| 81 | 81 | export type Visible = z.infer<typeof VisibleSchema>; |
| 82 | 82 | |
| 83 | 83 | export const OwnerSchema = z.object({ |
| @@ -89,13 +89,13 @@ export const OwnerSchema = z.object({ | ||
| 89 | 89 | "rights": z.array(z.string()), |
| 90 | 90 | "roleName": z.string(), |
| 91 | 91 | "screenName": z.string(), |
| 92 | -}); | |
| 92 | +}).strict(); | |
| 93 | 93 | export type Owner = z.infer<typeof OwnerSchema>; |
| 94 | 94 | |
| 95 | 95 | export const ExpressionSchema = z.object({ |
| 96 | 96 | "columnId": z.number().int(), |
| 97 | 97 | "type": z.string(), |
| 98 | -}); | |
| 98 | +}).strict(); | |
| 99 | 99 | export type Expression = z.infer<typeof ExpressionSchema>; |
| 100 | 100 | |
| 101 | 101 | export const CachedContentsSchema = z.object({ |
| @@ -104,7 +104,7 @@ export const CachedContentsSchema = z.object({ | ||
| 104 | 104 | "null": z.number().int(), |
| 105 | 105 | "smallest": z.string(), |
| 106 | 106 | "top": z.array(TopSchema), |
| 107 | -}); | |
| 107 | +}).strict(); | |
| 108 | 108 | export type CachedContents = z.infer<typeof CachedContentsSchema>; |
| 109 | 109 | |
| 110 | 110 | export const CustomFieldsSchema = z.object({ |
| @@ -113,23 +113,23 @@ export const CustomFieldsSchema = z.object({ | ||
| 113 | 113 | "Dataset Information": DatasetInformationSchema, |
| 114 | 114 | "Dataset Summary": DatasetSummarySchema, |
| 115 | 115 | "Notes": NotesSchema, |
| 116 | -}); | |
| 116 | +}).strict(); | |
| 117 | 117 | export type CustomFields = z.infer<typeof CustomFieldsSchema>; |
| 118 | 118 | |
| 119 | 119 | export const JsonQuerySchema = z.object({ |
| 120 | 120 | "order": z.array(OrderSchema), |
| 121 | -}); | |
| 121 | +}).strict(); | |
| 122 | 122 | export type JsonQuery = z.infer<typeof JsonQuerySchema>; |
| 123 | 123 | |
| 124 | 124 | export const RenderTypeConfigSchema = z.object({ |
| 125 | 125 | "visible": VisibleSchema, |
| 126 | -}); | |
| 126 | +}).strict(); | |
| 127 | 127 | export type RenderTypeConfig = z.infer<typeof RenderTypeConfigSchema>; |
| 128 | 128 | |
| 129 | 129 | export const OrderBySchema = z.object({ |
| 130 | 130 | "ascending": z.boolean(), |
| 131 | 131 | "expression": ExpressionSchema, |
| 132 | -}); | |
| 132 | +}).strict(); | |
| 133 | 133 | export type OrderBy = z.infer<typeof OrderBySchema>; |
| 134 | 134 | |
| 135 | 135 | export const ColumnSchema = z.object({ |
| @@ -145,7 +145,7 @@ export const ColumnSchema = z.object({ | ||
| 145 | 145 | "renderTypeName": TypeNameSchema, |
| 146 | 146 | "tableColumnId": z.number().int().optional(), |
| 147 | 147 | "width": z.number().int().optional(), |
| 148 | -}); | |
| 148 | +}).strict(); | |
| 149 | 149 | export type Column = z.infer<typeof ColumnSchema>; |
| 150 | 150 | |
| 151 | 151 | export const MetadataSchema = z.object({ |
| @@ -155,12 +155,12 @@ export const MetadataSchema = z.object({ | ||
| 155 | 155 | "jsonQuery": JsonQuerySchema, |
| 156 | 156 | "rdfSubject": z.string().regex(/^-?\d+$/), |
| 157 | 157 | "renderTypeConfig": RenderTypeConfigSchema, |
| 158 | -}); | |
| 158 | +}).strict(); | |
| 159 | 159 | export type Metadata = z.infer<typeof MetadataSchema>; |
| 160 | 160 | |
| 161 | 161 | export const QuerySchema = z.object({ |
| 162 | 162 | "orderBys": z.array(OrderBySchema), |
| 163 | -}); | |
| 163 | +}).strict(); | |
| 164 | 164 | export type Query = z.infer<typeof QuerySchema>; |
| 165 | 165 | |
| 166 | 166 | export const ViewSchema = z.object({ |
| @@ -202,16 +202,16 @@ export const ViewSchema = z.object({ | ||
| 202 | 202 | "viewCount": z.number().int(), |
| 203 | 203 | "viewLastModified": z.number().int(), |
| 204 | 204 | "viewType": z.string(), |
| 205 | -}); | |
| 205 | +}).strict(); | |
| 206 | 206 | export type View = z.infer<typeof ViewSchema>; |
| 207 | 207 | |
| 208 | 208 | export const MetaSchema = z.object({ |
| 209 | 209 | "view": ViewSchema, |
| 210 | -}); | |
| 210 | +}).strict(); | |
| 211 | 211 | export type Meta = z.infer<typeof MetaSchema>; |
| 212 | 212 | |
| 213 | 213 | export const TopLevelSchema = z.object({ |
| 214 | 214 | "data": z.array(z.array(z.union([z.null(), z.number().int(), z.string()]))), |
| 215 | 215 | "meta": MetaSchema, |
| 216 | -}); | |
| 216 | +}).strict(); | |
| 217 | 217 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/misc/61b66.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -11,14 +11,14 @@ export const StatusSchema = z.object({ | ||
| 11 | 11 | "reason": z.string(), |
| 12 | 12 | "trend": z.string(), |
| 13 | 13 | "type": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Status = z.infer<typeof StatusSchema>; |
| 16 | 16 | |
| 17 | 17 | export const MetaSchema = z.object({ |
| 18 | 18 | "credit": z.string(), |
| 19 | 19 | "updated": z.string(), |
| 20 | 20 | "url": z.string(), |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type Meta = z.infer<typeof MetaSchema>; |
| 23 | 23 | |
| 24 | 24 | export const WeatherSchema = z.object({ |
| @@ -27,7 +27,7 @@ export const WeatherSchema = z.object({ | ||
| 27 | 27 | "visibility": z.number(), |
| 28 | 28 | "weather": z.string(), |
| 29 | 29 | "wind": z.string(), |
| 30 | -}); | |
| 30 | +}).strict(); | |
| 31 | 31 | export type Weather = z.infer<typeof WeatherSchema>; |
| 32 | 32 | |
| 33 | 33 | export const TopLevelSchema = z.object({ |
| @@ -39,5 +39,5 @@ export const TopLevelSchema = z.object({ | ||
| 39 | 39 | "state": z.string(), |
| 40 | 40 | "status": StatusSchema, |
| 41 | 41 | "weather": WeatherSchema, |
| 42 | -}); | |
| 42 | +}).strict(); | |
| 43 | 43 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/6260a.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -5,5 +5,5 @@ export const TopLevelSchema = z.object({ | ||
| 5 | 5 | "base": z.string(), |
| 6 | 6 | "date": z.string(), |
| 7 | 7 | "rates": z.record(z.string(), z.number()), |
| 8 | -}); | |
| 8 | +}).strict(); | |
| 9 | 9 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/misc/65dec.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -57,13 +57,13 @@ export type Type = z.infer<typeof TypeSchema>; | ||
| 57 | 57 | export const LegalityElementSchema = z.object({ |
| 58 | 58 | "format": z.string(), |
| 59 | 59 | "legality": LegalityEnumSchema, |
| 60 | -}); | |
| 60 | +}).strict(); | |
| 61 | 61 | export type LegalityElement = z.infer<typeof LegalityElementSchema>; |
| 62 | 62 | |
| 63 | 63 | export const RulingSchema = z.object({ |
| 64 | 64 | "date": z.string(), |
| 65 | 65 | "text": z.string(), |
| 66 | -}); | |
| 66 | +}).strict(); | |
| 67 | 67 | export type Ruling = z.infer<typeof RulingSchema>; |
| 68 | 68 | |
| 69 | 69 | export const CardSchema = z.object({ |
| @@ -95,7 +95,7 @@ export const CardSchema = z.object({ | ||
| 95 | 95 | "types": z.array(TypeSchema), |
| 96 | 96 | "variations": z.array(z.number().int()).optional(), |
| 97 | 97 | "watermark": WatermarkSchema.optional(), |
| 98 | -}); | |
| 98 | +}).strict(); | |
| 99 | 99 | export type Card = z.infer<typeof CardSchema>; |
| 100 | 100 | |
| 101 | 101 | export const TopLevelSchema = z.object({ |
| @@ -110,5 +110,5 @@ export const TopLevelSchema = z.object({ | ||
| 110 | 110 | "name": z.string(), |
| 111 | 111 | "releaseDate": z.string(), |
| 112 | 112 | "type": z.string(), |
| 113 | -}); | |
| 113 | +}).strict(); | |
| 114 | 114 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/misc/66121.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -37,20 +37,20 @@ export type Title = z.infer<typeof TitleSchema>; | ||
| 37 | 37 | export const IdentifierSchema = z.object({ |
| 38 | 38 | "identifier": z.string(), |
| 39 | 39 | "scheme": SchemeSchema, |
| 40 | -}); | |
| 40 | +}).strict(); | |
| 41 | 41 | export type Identifier = z.infer<typeof IdentifierSchema>; |
| 42 | 42 | |
| 43 | 43 | export const LinkSchema = z.object({ |
| 44 | 44 | "note": NoteSchema, |
| 45 | 45 | "url": z.string(), |
| 46 | -}); | |
| 46 | +}).strict(); | |
| 47 | 47 | export type Link = z.infer<typeof LinkSchema>; |
| 48 | 48 | |
| 49 | 49 | export const TextSchema = z.object({ |
| 50 | 50 | "media_type": MediaTypeSchema, |
| 51 | 51 | "title": TitleSchema, |
| 52 | 52 | "url": z.string(), |
| 53 | -}); | |
| 53 | +}).strict(); | |
| 54 | 54 | export type Text = z.infer<typeof TextSchema>; |
| 55 | 55 | |
| 56 | 56 | export const TopLevelElementSchema = z.object({ |
| @@ -62,7 +62,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 62 | 62 | "other_names": z.array(z.any()), |
| 63 | 63 | "superseded_by": z.union([z.null(), z.string()]), |
| 64 | 64 | "text": z.array(TextSchema), |
| 65 | -}); | |
| 65 | +}).strict(); | |
| 66 | 66 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 67 | 67 | |
| 68 | 68 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +2 −2test/inputs/json/misc/6617c.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -4,12 +4,12 @@ import * as z from "zod"; | ||
| 4 | 4 | export const IssPositionSchema = z.object({ |
| 5 | 5 | "latitude": z.string(), |
| 6 | 6 | "longitude": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type IssPosition = z.infer<typeof IssPositionSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "iss_position": IssPositionSchema, |
| 12 | 12 | "message": z.string(), |
| 13 | 13 | "timestamp": z.number().int(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/json/misc/67c03.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -4,12 +4,12 @@ import * as z from "zod"; | ||
| 4 | 4 | export const PersonSchema = z.object({ |
| 5 | 5 | "craft": z.string(), |
| 6 | 6 | "name": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Person = z.infer<typeof PersonSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "message": z.string(), |
| 12 | 12 | "number": z.number().int(), |
| 13 | 13 | "people": z.array(PersonSchema), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/misc/68c30.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -9,14 +9,14 @@ export const OutSchema = z.object({ | ||
| 9 | 9 | "tx_index": z.number().int(), |
| 10 | 10 | "type": z.number().int(), |
| 11 | 11 | "value": z.number().int(), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type Out = z.infer<typeof OutSchema>; |
| 14 | 14 | |
| 15 | 15 | export const InputSchema = z.object({ |
| 16 | 16 | "prev_out": OutSchema, |
| 17 | 17 | "script": z.string(), |
| 18 | 18 | "sequence": z.number().int(), |
| 19 | -}); | |
| 19 | +}).strict(); | |
| 20 | 20 | export type Input = z.infer<typeof InputSchema>; |
| 21 | 21 | |
| 22 | 22 | export const TxSchema = z.object({ |
| @@ -32,10 +32,10 @@ export const TxSchema = z.object({ | ||
| 32 | 32 | "ver": z.number().int(), |
| 33 | 33 | "vin_sz": z.number().int(), |
| 34 | 34 | "vout_sz": z.number().int(), |
| 35 | -}); | |
| 35 | +}).strict(); | |
| 36 | 36 | export type Tx = z.infer<typeof TxSchema>; |
| 37 | 37 | |
| 38 | 38 | export const TopLevelSchema = z.object({ |
| 39 | 39 | "txs": z.array(TxSchema), |
| 40 | -}); | |
| 40 | +}).strict(); | |
| 41 | 41 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +7 −7test/inputs/json/misc/6c155.json
Mtypescript-zoddefault / TopLevel.ts+7 −7
| @@ -4,20 +4,20 @@ import * as z from "zod"; | ||
| 4 | 4 | export const ResponseInfoSchema = z.object({ |
| 5 | 5 | "developerMessage": z.string(), |
| 6 | 6 | "status": z.number().int(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type ResponseInfo = z.infer<typeof ResponseInfoSchema>; |
| 9 | 9 | |
| 10 | 10 | export const ResultsetSchema = z.object({ |
| 11 | 11 | "count": z.number().int(), |
| 12 | 12 | "page": z.number().int(), |
| 13 | 13 | "pagesize": z.number().int(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Resultset = z.infer<typeof ResultsetSchema>; |
| 16 | 16 | |
| 17 | 17 | export const ComponentSchema = z.object({ |
| 18 | 18 | "name": z.string(), |
| 19 | 19 | "uuid": z.string().uuid(), |
| 20 | -}); | |
| 20 | +}).strict(); | |
| 21 | 21 | export type Component = z.infer<typeof ComponentSchema>; |
| 22 | 22 | |
| 23 | 23 | export const LocationSchema = z.object({ |
| @@ -31,14 +31,14 @@ export const LocationSchema = z.object({ | ||
| 31 | 31 | "postal_code": z.string(), |
| 32 | 32 | "sub_premise": z.null(), |
| 33 | 33 | "thoroughfare": z.string(), |
| 34 | -}); | |
| 34 | +}).strict(); | |
| 35 | 35 | export type Location = z.infer<typeof LocationSchema>; |
| 36 | 36 | |
| 37 | 37 | export const MetadataSchema = z.object({ |
| 38 | 38 | "executionTime": z.number(), |
| 39 | 39 | "responseInfo": ResponseInfoSchema, |
| 40 | 40 | "resultset": ResultsetSchema, |
| 41 | -}); | |
| 41 | +}).strict(); | |
| 42 | 42 | export type Metadata = z.infer<typeof MetadataSchema>; |
| 43 | 43 | |
| 44 | 44 | export const ResultSchema = z.object({ |
| @@ -56,11 +56,11 @@ export const ResultSchema = z.object({ | ||
| 56 | 56 | "url": z.string(), |
| 57 | 57 | "uuid": z.string().uuid(), |
| 58 | 58 | "vuuid": z.string().uuid(), |
| 59 | -}); | |
| 59 | +}).strict(); | |
| 60 | 60 | export type Result = z.infer<typeof ResultSchema>; |
| 61 | 61 | |
| 62 | 62 | export const TopLevelSchema = z.object({ |
| 63 | 63 | "metadata": MetadataSchema, |
| 64 | 64 | "results": z.array(ResultSchema), |
| 65 | -}); | |
| 65 | +}).strict(); | |
| 66 | 66 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +12 −12test/inputs/json/misc/6de06.json
Mtypescript-zoddefault / TopLevel.ts+12 −12
| @@ -33,7 +33,7 @@ export const OembedSchema = z.object({ | ||
| 33 | 33 | "type": z.string(), |
| 34 | 34 | "version": z.string(), |
| 35 | 35 | "width": z.number().int(), |
| 36 | -}); | |
| 36 | +}).strict(); | |
| 37 | 37 | export type Oembed = z.infer<typeof OembedSchema>; |
| 38 | 38 | |
| 39 | 39 | export const MediaEmbedSchema = z.object({ |
| @@ -41,26 +41,26 @@ export const MediaEmbedSchema = z.object({ | ||
| 41 | 41 | "height": z.number().int().optional(), |
| 42 | 42 | "scrolling": z.boolean().optional(), |
| 43 | 43 | "width": z.number().int().optional(), |
| 44 | -}); | |
| 44 | +}).strict(); | |
| 45 | 45 | export type MediaEmbed = z.infer<typeof MediaEmbedSchema>; |
| 46 | 46 | |
| 47 | 47 | export const SourceSchema = z.object({ |
| 48 | 48 | "height": z.number().int(), |
| 49 | 49 | "url": z.string(), |
| 50 | 50 | "width": z.number().int(), |
| 51 | -}); | |
| 51 | +}).strict(); | |
| 52 | 52 | export type Source = z.infer<typeof SourceSchema>; |
| 53 | 53 | |
| 54 | 54 | export const GifSchema = z.object({ |
| 55 | 55 | "resolutions": z.array(SourceSchema), |
| 56 | 56 | "source": SourceSchema, |
| 57 | -}); | |
| 57 | +}).strict(); | |
| 58 | 58 | export type Gif = z.infer<typeof GifSchema>; |
| 59 | 59 | |
| 60 | 60 | export const MediaSchema = z.object({ |
| 61 | 61 | "oembed": OembedSchema, |
| 62 | 62 | "type": z.string(), |
| 63 | -}); | |
| 63 | +}).strict(); | |
| 64 | 64 | export type Media = z.infer<typeof MediaSchema>; |
| 65 | 65 | |
| 66 | 66 | export const VariantsSchema = z.object({ |
| @@ -68,7 +68,7 @@ export const VariantsSchema = z.object({ | ||
| 68 | 68 | "mp4": GifSchema.optional(), |
| 69 | 69 | "nsfw": GifSchema.optional(), |
| 70 | 70 | "obfuscated": GifSchema.optional(), |
| 71 | -}); | |
| 71 | +}).strict(); | |
| 72 | 72 | export type Variants = z.infer<typeof VariantsSchema>; |
| 73 | 73 | |
| 74 | 74 | export const ImageSchema = z.object({ |
| @@ -76,13 +76,13 @@ export const ImageSchema = z.object({ | ||
| 76 | 76 | "resolutions": z.array(SourceSchema), |
| 77 | 77 | "source": SourceSchema, |
| 78 | 78 | "variants": VariantsSchema, |
| 79 | -}); | |
| 79 | +}).strict(); | |
| 80 | 80 | export type Image = z.infer<typeof ImageSchema>; |
| 81 | 81 | |
| 82 | 82 | export const PreviewSchema = z.object({ |
| 83 | 83 | "enabled": z.boolean(), |
| 84 | 84 | "images": z.array(ImageSchema), |
| 85 | -}); | |
| 85 | +}).strict(); | |
| 86 | 86 | export type Preview = z.infer<typeof PreviewSchema>; |
| 87 | 87 | |
| 88 | 88 | export const ChildDataSchema = z.object({ |
| @@ -150,13 +150,13 @@ export const ChildDataSchema = z.object({ | ||
| 150 | 150 | "user_reports": z.array(z.any()), |
| 151 | 151 | "view_count": z.null(), |
| 152 | 152 | "visited": z.boolean(), |
| 153 | -}); | |
| 153 | +}).strict(); | |
| 154 | 154 | export type ChildData = z.infer<typeof ChildDataSchema>; |
| 155 | 155 | |
| 156 | 156 | export const ChildSchema = z.object({ |
| 157 | 157 | "data": ChildDataSchema, |
| 158 | 158 | "kind": KindSchema, |
| 159 | -}); | |
| 159 | +}).strict(); | |
| 160 | 160 | export type Child = z.infer<typeof ChildSchema>; |
| 161 | 161 | |
| 162 | 162 | export const TopLevelDataSchema = z.object({ |
| @@ -164,11 +164,11 @@ export const TopLevelDataSchema = z.object({ | ||
| 164 | 164 | "before": z.null(), |
| 165 | 165 | "children": z.array(ChildSchema), |
| 166 | 166 | "modhash": z.string(), |
| 167 | -}); | |
| 167 | +}).strict(); | |
| 168 | 168 | export type TopLevelData = z.infer<typeof TopLevelDataSchema>; |
| 169 | 169 | |
| 170 | 170 | export const TopLevelSchema = z.object({ |
| 171 | 171 | "data": TopLevelDataSchema, |
| 172 | 172 | "kind": z.string(), |
| 173 | -}); | |
| 173 | +}).strict(); | |
| 174 | 174 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +14 −14test/inputs/json/misc/6dec6.json
Mtypescript-zoddefault / TopLevel.ts+14 −14
| @@ -11,7 +11,7 @@ export type Text = z.infer<typeof TextSchema>; | ||
| 11 | 11 | export const AstronomySchema = z.object({ |
| 12 | 12 | "sunrise": z.string(), |
| 13 | 13 | "sunset": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Astronomy = z.infer<typeof AstronomySchema>; |
| 16 | 16 | |
| 17 | 17 | export const AtmosphereSchema = z.object({ |
| @@ -19,7 +19,7 @@ export const AtmosphereSchema = z.object({ | ||
| 19 | 19 | "pressure": z.string(), |
| 20 | 20 | "rising": z.string().regex(/^-?\d+$/), |
| 21 | 21 | "visibility": z.string(), |
| 22 | -}); | |
| 22 | +}).strict(); | |
| 23 | 23 | export type Atmosphere = z.infer<typeof AtmosphereSchema>; |
| 24 | 24 | |
| 25 | 25 | export const ImageSchema = z.object({ |
| @@ -28,7 +28,7 @@ export const ImageSchema = z.object({ | ||
| 28 | 28 | "title": z.string(), |
| 29 | 29 | "url": z.string(), |
| 30 | 30 | "width": z.string().regex(/^-?\d+$/), |
| 31 | -}); | |
| 31 | +}).strict(); | |
| 32 | 32 | export type Image = z.infer<typeof ImageSchema>; |
| 33 | 33 | |
| 34 | 34 | export const ConditionSchema = z.object({ |
| @@ -36,7 +36,7 @@ export const ConditionSchema = z.object({ | ||
| 36 | 36 | "date": z.string(), |
| 37 | 37 | "temp": z.string().regex(/^-?\d+$/), |
| 38 | 38 | "text": z.string(), |
| 39 | -}); | |
| 39 | +}).strict(); | |
| 40 | 40 | export type Condition = z.infer<typeof ConditionSchema>; |
| 41 | 41 | |
| 42 | 42 | export const ForecastSchema = z.object({ |
| @@ -46,19 +46,19 @@ export const ForecastSchema = z.object({ | ||
| 46 | 46 | "high": z.string().regex(/^-?\d+$/), |
| 47 | 47 | "low": z.string().regex(/^-?\d+$/), |
| 48 | 48 | "text": TextSchema, |
| 49 | -}); | |
| 49 | +}).strict(); | |
| 50 | 50 | export type Forecast = z.infer<typeof ForecastSchema>; |
| 51 | 51 | |
| 52 | 52 | export const GuidSchema = z.object({ |
| 53 | 53 | "isPermaLink": z.enum(["true", "false"]), |
| 54 | -}); | |
| 54 | +}).strict(); | |
| 55 | 55 | export type Guid = z.infer<typeof GuidSchema>; |
| 56 | 56 | |
| 57 | 57 | export const LocationSchema = z.object({ |
| 58 | 58 | "city": z.string(), |
| 59 | 59 | "country": z.string(), |
| 60 | 60 | "region": z.string(), |
| 61 | -}); | |
| 61 | +}).strict(); | |
| 62 | 62 | export type Location = z.infer<typeof LocationSchema>; |
| 63 | 63 | |
| 64 | 64 | export const UnitsSchema = z.object({ |
| @@ -66,14 +66,14 @@ export const UnitsSchema = z.object({ | ||
| 66 | 66 | "pressure": z.string(), |
| 67 | 67 | "speed": z.string(), |
| 68 | 68 | "temperature": z.string(), |
| 69 | -}); | |
| 69 | +}).strict(); | |
| 70 | 70 | export type Units = z.infer<typeof UnitsSchema>; |
| 71 | 71 | |
| 72 | 72 | export const WindSchema = z.object({ |
| 73 | 73 | "chill": z.string().regex(/^-?\d+$/), |
| 74 | 74 | "direction": z.string().regex(/^-?\d+$/), |
| 75 | 75 | "speed": z.string().regex(/^-?\d+$/), |
| 76 | -}); | |
| 76 | +}).strict(); | |
| 77 | 77 | export type Wind = z.infer<typeof WindSchema>; |
| 78 | 78 | |
| 79 | 79 | export const ItemSchema = z.object({ |
| @@ -86,7 +86,7 @@ export const ItemSchema = z.object({ | ||
| 86 | 86 | "long": z.string(), |
| 87 | 87 | "pubDate": z.string(), |
| 88 | 88 | "title": z.string(), |
| 89 | -}); | |
| 89 | +}).strict(); | |
| 90 | 90 | export type Item = z.infer<typeof ItemSchema>; |
| 91 | 91 | |
| 92 | 92 | export const ChannelSchema = z.object({ |
| @@ -103,12 +103,12 @@ export const ChannelSchema = z.object({ | ||
| 103 | 103 | "ttl": z.string().regex(/^-?\d+$/), |
| 104 | 104 | "units": UnitsSchema, |
| 105 | 105 | "wind": WindSchema, |
| 106 | -}); | |
| 106 | +}).strict(); | |
| 107 | 107 | export type Channel = z.infer<typeof ChannelSchema>; |
| 108 | 108 | |
| 109 | 109 | export const ResultsSchema = z.object({ |
| 110 | 110 | "channel": ChannelSchema, |
| 111 | -}); | |
| 111 | +}).strict(); | |
| 112 | 112 | export type Results = z.infer<typeof ResultsSchema>; |
| 113 | 113 | |
| 114 | 114 | export const QuerySchema = z.object({ |
| @@ -116,10 +116,10 @@ export const QuerySchema = z.object({ | ||
| 116 | 116 | "created": z.coerce.date(), |
| 117 | 117 | "lang": z.string(), |
| 118 | 118 | "results": ResultsSchema, |
| 119 | -}); | |
| 119 | +}).strict(); | |
| 120 | 120 | export type Query = z.infer<typeof QuerySchema>; |
| 121 | 121 | |
| 122 | 122 | export const TopLevelSchema = z.object({ |
| 123 | 123 | "query": QuerySchema, |
| 124 | -}); | |
| 124 | +}).strict(); | |
| 125 | 125 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/6eb00.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -5,7 +5,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 5 | 5 | "DirectorateID": z.number().int(), |
| 6 | 6 | "Id": z.number().int(), |
| 7 | 7 | "Name": z.string(), |
| 8 | -}); | |
| 8 | +}).strict(); | |
| 9 | 9 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 10 | 10 | |
| 11 | 11 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +1 −1test/inputs/json/misc/70c77.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -5,5 +5,5 @@ export const TopLevelSchema = z.object({ | ||
| 5 | 5 | "base": z.string(), |
| 6 | 6 | "date": z.string(), |
| 7 | 7 | "rates": z.record(z.string(), z.number()), |
| 8 | -}); | |
| 8 | +}).strict(); | |
| 9 | 9 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +3 −3test/inputs/json/misc/734ad.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -8,7 +8,7 @@ export const StatusSchema = z.enum([ | ||
| 8 | 8 | export type Status = z.infer<typeof StatusSchema>; |
| 9 | 9 | |
| 10 | 10 | export const FacetsSchema = z.object({ |
| 11 | -}); | |
| 11 | +}).strict(); | |
| 12 | 12 | export type Facets = z.infer<typeof FacetsSchema>; |
| 13 | 13 | |
| 14 | 14 | export const ResultSchema = z.object({ |
| @@ -70,7 +70,7 @@ export const ResultSchema = z.object({ | ||
| 70 | 70 | "updated_at": z.coerce.date(), |
| 71 | 71 | "uri": z.string(), |
| 72 | 72 | "web_site_url": z.union([z.null(), z.string()]), |
| 73 | -}); | |
| 73 | +}).strict(); | |
| 74 | 74 | export type Result = z.infer<typeof ResultSchema>; |
| 75 | 75 | |
| 76 | 76 | export const TopLevelSchema = z.object({ |
| @@ -81,5 +81,5 @@ export const TopLevelSchema = z.object({ | ||
| 81 | 81 | "offset": z.number().int(), |
| 82 | 82 | "previous": z.boolean(), |
| 83 | 83 | "results": z.array(ResultSchema), |
| 84 | -}); | |
| 84 | +}).strict(); | |
| 85 | 85 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/75912.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -5,5 +5,5 @@ export const TopLevelSchema = z.object({ | ||
| 5 | 5 | "base": z.string(), |
| 6 | 6 | "date": z.string(), |
| 7 | 7 | "rates": z.record(z.string(), z.number()), |
| 8 | -}); | |
| 8 | +}).strict(); | |
| 9 | 9 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +10 −10test/inputs/json/misc/7681c.json
Mtypescript-zoddefault / TopLevel.ts+10 −10
| @@ -28,7 +28,7 @@ export const The480_WStillSchema = z.object({ | ||
| 28 | 28 | "size": z.string().regex(/^-?\d+$/).optional(), |
| 29 | 29 | "url": z.string(), |
| 30 | 30 | "width": z.string().regex(/^-?\d+$/), |
| 31 | -}); | |
| 31 | +}).strict(); | |
| 32 | 32 | export type The480_WStill = z.infer<typeof The480_WStillSchema>; |
| 33 | 33 | |
| 34 | 34 | export const DownsizedSmallSchema = z.object({ |
| @@ -36,7 +36,7 @@ export const DownsizedSmallSchema = z.object({ | ||
| 36 | 36 | "mp4": z.string(), |
| 37 | 37 | "mp4_size": z.string().regex(/^-?\d+$/), |
| 38 | 38 | "width": z.string().regex(/^-?\d+$/), |
| 39 | -}); | |
| 39 | +}).strict(); | |
| 40 | 40 | export type DownsizedSmall = z.infer<typeof DownsizedSmallSchema>; |
| 41 | 41 | |
| 42 | 42 | export const FixedHeightSchema = z.object({ |
| @@ -50,13 +50,13 @@ export const FixedHeightSchema = z.object({ | ||
| 50 | 50 | "webp": z.string(), |
| 51 | 51 | "webp_size": z.string().regex(/^-?\d+$/), |
| 52 | 52 | "width": z.string().regex(/^-?\d+$/), |
| 53 | -}); | |
| 53 | +}).strict(); | |
| 54 | 54 | export type FixedHeight = z.infer<typeof FixedHeightSchema>; |
| 55 | 55 | |
| 56 | 56 | export const LoopingSchema = z.object({ |
| 57 | 57 | "mp4": z.string(), |
| 58 | 58 | "mp4_size": z.string().regex(/^-?\d+$/), |
| 59 | -}); | |
| 59 | +}).strict(); | |
| 60 | 60 | export type Looping = z.infer<typeof LoopingSchema>; |
| 61 | 61 | |
| 62 | 62 | export const UserSchema = z.object({ |
| @@ -66,21 +66,21 @@ export const UserSchema = z.object({ | ||
| 66 | 66 | "profile_url": z.string(), |
| 67 | 67 | "twitter": z.string().optional(), |
| 68 | 68 | "username": z.string(), |
| 69 | -}); | |
| 69 | +}).strict(); | |
| 70 | 70 | export type User = z.infer<typeof UserSchema>; |
| 71 | 71 | |
| 72 | 72 | export const MetaSchema = z.object({ |
| 73 | 73 | "msg": z.string(), |
| 74 | 74 | "response_id": z.string(), |
| 75 | 75 | "status": z.number().int(), |
| 76 | -}); | |
| 76 | +}).strict(); | |
| 77 | 77 | export type Meta = z.infer<typeof MetaSchema>; |
| 78 | 78 | |
| 79 | 79 | export const PaginationSchema = z.object({ |
| 80 | 80 | "count": z.number().int(), |
| 81 | 81 | "offset": z.number().int(), |
| 82 | 82 | "total_count": z.number().int(), |
| 83 | -}); | |
| 83 | +}).strict(); | |
| 84 | 84 | export type Pagination = z.infer<typeof PaginationSchema>; |
| 85 | 85 | |
| 86 | 86 | export const ImagesSchema = z.object({ |
| @@ -107,7 +107,7 @@ export const ImagesSchema = z.object({ | ||
| 107 | 107 | "preview_gif": The480_WStillSchema, |
| 108 | 108 | "preview_webp": The480_WStillSchema, |
| 109 | 109 | "480w_still": The480_WStillSchema.optional(), |
| 110 | -}); | |
| 110 | +}).strict(); | |
| 111 | 111 | export type Images = z.infer<typeof ImagesSchema>; |
| 112 | 112 | |
| 113 | 113 | export const DatumSchema = z.object({ |
| @@ -129,12 +129,12 @@ export const DatumSchema = z.object({ | ||
| 129 | 129 | "url": z.string(), |
| 130 | 130 | "user": UserSchema.optional(), |
| 131 | 131 | "username": UsernameSchema, |
| 132 | -}); | |
| 132 | +}).strict(); | |
| 133 | 133 | export type Datum = z.infer<typeof DatumSchema>; |
| 134 | 134 | |
| 135 | 135 | export const TopLevelSchema = z.object({ |
| 136 | 136 | "data": z.array(DatumSchema), |
| 137 | 137 | "meta": MetaSchema, |
| 138 | 138 | "pagination": PaginationSchema, |
| 139 | -}); | |
| 139 | +}).strict(); | |
| 140 | 140 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +25 −25test/inputs/json/misc/76ae1.json
Mtypescript-zoddefault / TopLevel.ts+25 −25
| @@ -21,7 +21,7 @@ export type SchemaType = z.infer<typeof SchemaTypeSchema>; | ||
| 21 | 21 | export const PropertySchema = z.object({ |
| 22 | 22 | "description": z.string(), |
| 23 | 23 | "type": FormatEnumSchema, |
| 24 | -}); | |
| 24 | +}).strict(); | |
| 25 | 25 | export type Property = z.infer<typeof PropertySchema>; |
| 26 | 26 | |
| 27 | 27 | export const DeMinimisPropertiesSchema = z.object({ |
| @@ -32,7 +32,7 @@ export const DeMinimisPropertiesSchema = z.object({ | ||
| 32 | 32 | "notes": PropertySchema, |
| 33 | 33 | "vat_amount": PropertySchema, |
| 34 | 34 | "vat_currency": PropertySchema, |
| 35 | -}); | |
| 35 | +}).strict(); | |
| 36 | 36 | export type DeMinimisProperties = z.infer<typeof DeMinimisPropertiesSchema>; |
| 37 | 37 | |
| 38 | 38 | export const FaqPropertiesSchema = z.object({ |
| @@ -47,7 +47,7 @@ export const FaqPropertiesSchema = z.object({ | ||
| 47 | 47 | "trade_regions": PropertySchema, |
| 48 | 48 | "url": PropertySchema, |
| 49 | 49 | "world_regions": PropertySchema, |
| 50 | -}); | |
| 50 | +}).strict(); | |
| 51 | 51 | export type FaqProperties = z.infer<typeof FaqPropertiesSchema>; |
| 52 | 52 | |
| 53 | 53 | export const ReportPropertiesSchema = z.object({ |
| @@ -60,7 +60,7 @@ export const ReportPropertiesSchema = z.object({ | ||
| 60 | 60 | "report_type": PropertySchema, |
| 61 | 61 | "title": PropertySchema, |
| 62 | 62 | "url": PropertySchema, |
| 63 | -}); | |
| 63 | +}).strict(); | |
| 64 | 64 | export type ReportProperties = z.infer<typeof ReportPropertiesSchema>; |
| 65 | 65 | |
| 66 | 66 | export const TaxonomyPropertiesSchema = z.object({ |
| @@ -70,14 +70,14 @@ export const TaxonomyPropertiesSchema = z.object({ | ||
| 70 | 70 | "label": PropertySchema, |
| 71 | 71 | "sub_class_of": PropertySchema, |
| 72 | 72 | "type": PropertySchema, |
| 73 | -}); | |
| 73 | +}).strict(); | |
| 74 | 74 | export type TaxonomyProperties = z.infer<typeof TaxonomyPropertiesSchema>; |
| 75 | 75 | |
| 76 | 76 | export const InfoSchema = z.object({ |
| 77 | 77 | "description": z.string(), |
| 78 | 78 | "title": z.string(), |
| 79 | 79 | "version": z.string(), |
| 80 | -}); | |
| 80 | +}).strict(); | |
| 81 | 81 | export type Info = z.infer<typeof InfoSchema>; |
| 82 | 82 | |
| 83 | 83 | export const ParameterSchema = z.object({ |
| @@ -87,55 +87,55 @@ export const ParameterSchema = z.object({ | ||
| 87 | 87 | "name": z.string(), |
| 88 | 88 | "required": z.boolean(), |
| 89 | 89 | "type": FormatEnumSchema, |
| 90 | -}); | |
| 90 | +}).strict(); | |
| 91 | 91 | export type Parameter = z.infer<typeof ParameterSchema>; |
| 92 | 92 | |
| 93 | 93 | export const ItemsClassSchema = z.object({ |
| 94 | 94 | "$ref": z.string(), |
| 95 | -}); | |
| 95 | +}).strict(); | |
| 96 | 96 | export type ItemsClass = z.infer<typeof ItemsClassSchema>; |
| 97 | 97 | |
| 98 | 98 | export const PurpleSchemaSchema = z.object({ |
| 99 | 99 | "items": ItemsClassSchema, |
| 100 | 100 | "type": SchemaTypeSchema, |
| 101 | -}); | |
| 101 | +}).strict(); | |
| 102 | 102 | export type PurpleSchema = z.infer<typeof PurpleSchemaSchema>; |
| 103 | 103 | |
| 104 | 104 | export const ArticleSchema = z.object({ |
| 105 | 105 | "properties": z.record(z.string(), PropertySchema), |
| 106 | -}); | |
| 106 | +}).strict(); | |
| 107 | 107 | export type Article = z.infer<typeof ArticleSchema>; |
| 108 | 108 | |
| 109 | 109 | export const DeMinimisSchema = z.object({ |
| 110 | 110 | "properties": DeMinimisPropertiesSchema, |
| 111 | -}); | |
| 111 | +}).strict(); | |
| 112 | 112 | export type DeMinimis = z.infer<typeof DeMinimisSchema>; |
| 113 | 113 | |
| 114 | 114 | export const FaqSchema = z.object({ |
| 115 | 115 | "properties": FaqPropertiesSchema, |
| 116 | -}); | |
| 116 | +}).strict(); | |
| 117 | 117 | export type Faq = z.infer<typeof FaqSchema>; |
| 118 | 118 | |
| 119 | 119 | export const ReportSchema = z.object({ |
| 120 | 120 | "properties": ReportPropertiesSchema, |
| 121 | -}); | |
| 121 | +}).strict(); | |
| 122 | 122 | export type Report = z.infer<typeof ReportSchema>; |
| 123 | 123 | |
| 124 | 124 | export const TaxonomySchema = z.object({ |
| 125 | 125 | "properties": TaxonomyPropertiesSchema, |
| 126 | -}); | |
| 126 | +}).strict(); | |
| 127 | 127 | export type Taxonomy = z.infer<typeof TaxonomySchema>; |
| 128 | 128 | |
| 129 | 129 | export const Purple200Schema = z.object({ |
| 130 | 130 | "description": z.string(), |
| 131 | 131 | "schema": ItemsClassSchema, |
| 132 | -}); | |
| 132 | +}).strict(); | |
| 133 | 133 | export type Purple200 = z.infer<typeof Purple200Schema>; |
| 134 | 134 | |
| 135 | 135 | export const Fluffy200Schema = z.object({ |
| 136 | 136 | "description": z.string(), |
| 137 | 137 | "schema": PurpleSchemaSchema, |
| 138 | -}); | |
| 138 | +}).strict(); | |
| 139 | 139 | export type Fluffy200 = z.infer<typeof Fluffy200Schema>; |
| 140 | 140 | |
| 141 | 141 | export const DefinitionsSchema = z.object({ |
| @@ -152,17 +152,17 @@ export const DefinitionsSchema = z.object({ | ||
| 152 | 152 | "Rate": ArticleSchema, |
| 153 | 153 | "Report": ReportSchema, |
| 154 | 154 | "Taxonomy": TaxonomySchema, |
| 155 | -}); | |
| 155 | +}).strict(); | |
| 156 | 156 | export type Definitions = z.infer<typeof DefinitionsSchema>; |
| 157 | 157 | |
| 158 | 158 | export const PurpleResponsesSchema = z.object({ |
| 159 | 159 | "200": Purple200Schema, |
| 160 | -}); | |
| 160 | +}).strict(); | |
| 161 | 161 | export type PurpleResponses = z.infer<typeof PurpleResponsesSchema>; |
| 162 | 162 | |
| 163 | 163 | export const FluffyResponsesSchema = z.object({ |
| 164 | 164 | "200": Fluffy200Schema, |
| 165 | -}); | |
| 165 | +}).strict(); | |
| 166 | 166 | export type FluffyResponses = z.infer<typeof FluffyResponsesSchema>; |
| 167 | 167 | |
| 168 | 168 | export const BusinessServiceProvidersSearchGetSchema = z.object({ |
| @@ -171,7 +171,7 @@ export const BusinessServiceProvidersSearchGetSchema = z.object({ | ||
| 171 | 171 | "responses": PurpleResponsesSchema, |
| 172 | 172 | "summary": z.string(), |
| 173 | 173 | "tags": z.array(z.string()), |
| 174 | -}); | |
| 174 | +}).strict(); | |
| 175 | 175 | export type BusinessServiceProvidersSearchGet = z.infer<typeof BusinessServiceProvidersSearchGetSchema>; |
| 176 | 176 | |
| 177 | 177 | export const ConsolidatedScreeningListSearchGetSchema = z.object({ |
| @@ -180,17 +180,17 @@ export const ConsolidatedScreeningListSearchGetSchema = z.object({ | ||
| 180 | 180 | "responses": FluffyResponsesSchema, |
| 181 | 181 | "summary": z.string(), |
| 182 | 182 | "tags": z.array(z.string()), |
| 183 | -}); | |
| 183 | +}).strict(); | |
| 184 | 184 | export type ConsolidatedScreeningListSearchGet = z.infer<typeof ConsolidatedScreeningListSearchGetSchema>; |
| 185 | 185 | |
| 186 | 186 | export const BusinessServiceProvidersSearchClassSchema = z.object({ |
| 187 | 187 | "get": BusinessServiceProvidersSearchGetSchema, |
| 188 | -}); | |
| 188 | +}).strict(); | |
| 189 | 189 | export type BusinessServiceProvidersSearchClass = z.infer<typeof BusinessServiceProvidersSearchClassSchema>; |
| 190 | 190 | |
| 191 | 191 | export const ConsolidatedScreeningListSearchClassSchema = z.object({ |
| 192 | 192 | "get": ConsolidatedScreeningListSearchGetSchema, |
| 193 | -}); | |
| 193 | +}).strict(); | |
| 194 | 194 | export type ConsolidatedScreeningListSearchClass = z.infer<typeof ConsolidatedScreeningListSearchClassSchema>; |
| 195 | 195 | |
| 196 | 196 | export const PathsSchema = z.object({ |
| @@ -207,7 +207,7 @@ export const PathsSchema = z.object({ | ||
| 207 | 207 | "/trade_articles/search": ConsolidatedScreeningListSearchClassSchema, |
| 208 | 208 | "/trade_events/search": ConsolidatedScreeningListSearchClassSchema, |
| 209 | 209 | "/trade_leads/search": ConsolidatedScreeningListSearchClassSchema, |
| 210 | -}); | |
| 210 | +}).strict(); | |
| 211 | 211 | export type Paths = z.infer<typeof PathsSchema>; |
| 212 | 212 | |
| 213 | 213 | export const TopLevelSchema = z.object({ |
| @@ -219,5 +219,5 @@ export const TopLevelSchema = z.object({ | ||
| 219 | 219 | "produces": z.array(z.string()), |
| 220 | 220 | "schemes": z.array(z.string()), |
| 221 | 221 | "swagger": z.string(), |
| 222 | -}); | |
| 222 | +}).strict(); | |
| 223 | 223 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/77392.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -33,7 +33,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 33 | 33 | "pha": PhaSchema, |
| 34 | 34 | "q_au_1": z.string(), |
| 35 | 35 | "q_au_2": z.string().optional(), |
| 36 | -}); | |
| 36 | +}).strict(); | |
| 37 | 37 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 38 | 38 | |
| 39 | 39 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +13 −13test/inputs/json/misc/7d397.json
Mtypescript-zoddefault / TopLevel.ts+13 −13
| @@ -15,14 +15,14 @@ export type In = z.infer<typeof InSchema>; | ||
| 15 | 15 | export const PropertySchema = z.object({ |
| 16 | 16 | "description": z.string(), |
| 17 | 17 | "type": TypeSchema, |
| 18 | -}); | |
| 18 | +}).strict(); | |
| 19 | 19 | export type Property = z.infer<typeof PropertySchema>; |
| 20 | 20 | |
| 21 | 21 | export const InfoSchema = z.object({ |
| 22 | 22 | "description": z.string(), |
| 23 | 23 | "title": z.string(), |
| 24 | 24 | "version": z.string(), |
| 25 | -}); | |
| 25 | +}).strict(); | |
| 26 | 26 | export type Info = z.infer<typeof InfoSchema>; |
| 27 | 27 | |
| 28 | 28 | export const ParameterSchema = z.object({ |
| @@ -32,39 +32,39 @@ export const ParameterSchema = z.object({ | ||
| 32 | 32 | "name": z.string(), |
| 33 | 33 | "required": z.boolean(), |
| 34 | 34 | "type": TypeSchema, |
| 35 | -}); | |
| 35 | +}).strict(); | |
| 36 | 36 | export type Parameter = z.infer<typeof ParameterSchema>; |
| 37 | 37 | |
| 38 | 38 | export const ItemsSchema = z.object({ |
| 39 | 39 | "$ref": z.string(), |
| 40 | -}); | |
| 40 | +}).strict(); | |
| 41 | 41 | export type Items = z.infer<typeof ItemsSchema>; |
| 42 | 42 | |
| 43 | 43 | export const ListSchema = z.object({ |
| 44 | 44 | "properties": z.record(z.string(), PropertySchema), |
| 45 | -}); | |
| 45 | +}).strict(); | |
| 46 | 46 | export type List = z.infer<typeof ListSchema>; |
| 47 | 47 | |
| 48 | 48 | export const SchemaSchema = z.object({ |
| 49 | 49 | "items": ItemsSchema, |
| 50 | 50 | "type": z.string(), |
| 51 | -}); | |
| 51 | +}).strict(); | |
| 52 | 52 | export type Schema = z.infer<typeof SchemaSchema>; |
| 53 | 53 | |
| 54 | 54 | export const DefinitionsSchema = z.object({ |
| 55 | 55 | "List": ListSchema, |
| 56 | -}); | |
| 56 | +}).strict(); | |
| 57 | 57 | export type Definitions = z.infer<typeof DefinitionsSchema>; |
| 58 | 58 | |
| 59 | 59 | export const The200Schema = z.object({ |
| 60 | 60 | "description": z.string(), |
| 61 | 61 | "schema": SchemaSchema, |
| 62 | -}); | |
| 62 | +}).strict(); | |
| 63 | 63 | export type The200 = z.infer<typeof The200Schema>; |
| 64 | 64 | |
| 65 | 65 | export const ResponsesSchema = z.object({ |
| 66 | 66 | "200": The200Schema, |
| 67 | -}); | |
| 67 | +}).strict(); | |
| 68 | 68 | export type Responses = z.infer<typeof ResponsesSchema>; |
| 69 | 69 | |
| 70 | 70 | export const GetSchema = z.object({ |
| @@ -73,17 +73,17 @@ export const GetSchema = z.object({ | ||
| 73 | 73 | "responses": ResponsesSchema, |
| 74 | 74 | "summary": z.string(), |
| 75 | 75 | "tags": z.array(z.string()), |
| 76 | -}); | |
| 76 | +}).strict(); | |
| 77 | 77 | export type Get = z.infer<typeof GetSchema>; |
| 78 | 78 | |
| 79 | 79 | export const ConsolidatedScreeningListSearchSchema = z.object({ |
| 80 | 80 | "get": GetSchema, |
| 81 | -}); | |
| 81 | +}).strict(); | |
| 82 | 82 | export type ConsolidatedScreeningListSearch = z.infer<typeof ConsolidatedScreeningListSearchSchema>; |
| 83 | 83 | |
| 84 | 84 | export const PathsSchema = z.object({ |
| 85 | 85 | "/consolidated_screening_list/search": ConsolidatedScreeningListSearchSchema, |
| 86 | -}); | |
| 86 | +}).strict(); | |
| 87 | 87 | export type Paths = z.infer<typeof PathsSchema>; |
| 88 | 88 | |
| 89 | 89 | export const TopLevelSchema = z.object({ |
| @@ -95,5 +95,5 @@ export const TopLevelSchema = z.object({ | ||
| 95 | 95 | "produces": z.array(z.string()), |
| 96 | 96 | "schemes": z.array(z.string()), |
| 97 | 97 | "swagger": z.string(), |
| 98 | -}); | |
| 98 | +}).strict(); | |
| 99 | 99 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/misc/7d722.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -11,14 +11,14 @@ export const StatusSchema = z.object({ | ||
| 11 | 11 | "reason": z.string(), |
| 12 | 12 | "trend": z.string(), |
| 13 | 13 | "type": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Status = z.infer<typeof StatusSchema>; |
| 16 | 16 | |
| 17 | 17 | export const MetaSchema = z.object({ |
| 18 | 18 | "credit": z.string(), |
| 19 | 19 | "updated": z.string(), |
| 20 | 20 | "url": z.string(), |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type Meta = z.infer<typeof MetaSchema>; |
| 23 | 23 | |
| 24 | 24 | export const WeatherSchema = z.object({ |
| @@ -27,7 +27,7 @@ export const WeatherSchema = z.object({ | ||
| 27 | 27 | "visibility": z.number(), |
| 28 | 28 | "weather": z.string(), |
| 29 | 29 | "wind": z.string(), |
| 30 | -}); | |
| 30 | +}).strict(); | |
| 31 | 31 | export type Weather = z.infer<typeof WeatherSchema>; |
| 32 | 32 | |
| 33 | 33 | export const TopLevelSchema = z.object({ |
| @@ -39,5 +39,5 @@ export const TopLevelSchema = z.object({ | ||
| 39 | 39 | "state": z.string(), |
| 40 | 40 | "status": StatusSchema, |
| 41 | 41 | "weather": WeatherSchema, |
| 42 | -}); | |
| 42 | +}).strict(); | |
| 43 | 43 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/json/misc/7df41.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -5,7 +5,7 @@ export const PcSchema = z.object({ | ||
| 5 | 5 | "count": z.number().int(), |
| 6 | 6 | "label": z.string(), |
| 7 | 7 | "peak24": z.number().int(), |
| 8 | -}); | |
| 8 | +}).strict(); | |
| 9 | 9 | export type Pc = z.infer<typeof PcSchema>; |
| 10 | 10 | |
| 11 | 11 | export const TopLevelSchema = z.object({ |
| @@ -14,5 +14,5 @@ export const TopLevelSchema = z.object({ | ||
| 14 | 14 | "ps4": PcSchema, |
| 15 | 15 | "xbox": PcSchema, |
| 16 | 16 | "xone": PcSchema, |
| 17 | -}); | |
| 17 | +}).strict(); | |
| 18 | 18 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/json/misc/7dfa6.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -4,10 +4,10 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TotalPopulationSchema = z.object({ |
| 5 | 5 | "date": z.string(), |
| 6 | 6 | "population": z.number().int(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type TotalPopulation = z.infer<typeof TotalPopulationSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "total_population": z.array(TotalPopulationSchema), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +3 −3test/inputs/json/misc/7eb30.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -37,7 +37,7 @@ export const GroupSchema = z.object({ | ||
| 37 | 37 | "english": EnglishSchema, |
| 38 | 38 | "thai": ThaiSchema, |
| 39 | 39 | "website": z.string(), |
| 40 | -}); | |
| 40 | +}).strict(); | |
| 41 | 41 | export type Group = z.infer<typeof GroupSchema>; |
| 42 | 42 | |
| 43 | 43 | export const ResultSchema = z.object({ |
| @@ -55,7 +55,7 @@ export const ResultSchema = z.object({ | ||
| 55 | 55 | "today_screens": z.number().int(), |
| 56 | 56 | "url": z.string(), |
| 57 | 57 | "website": z.string(), |
| 58 | -}); | |
| 58 | +}).strict(); | |
| 59 | 59 | export type Result = z.infer<typeof ResultSchema>; |
| 60 | 60 | |
| 61 | 61 | export const TopLevelSchema = z.object({ |
| @@ -63,5 +63,5 @@ export const TopLevelSchema = z.object({ | ||
| 63 | 63 | "next": z.string(), |
| 64 | 64 | "previous": z.null(), |
| 65 | 65 | "results": z.array(ResultSchema), |
| 66 | -}); | |
| 66 | +}).strict(); | |
| 67 | 67 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/json/misc/7f568.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -18,7 +18,7 @@ export const FileSchema = z.object({ | ||
| 18 | 18 | "raw_url": z.string(), |
| 19 | 19 | "size": z.number().int(), |
| 20 | 20 | "type": TypeSchema, |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type File = z.infer<typeof FileSchema>; |
| 23 | 23 | |
| 24 | 24 | export const TopLevelElementSchema = z.object({ |
| @@ -38,7 +38,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 38 | 38 | "updated_at": z.coerce.date(), |
| 39 | 39 | "url": z.string(), |
| 40 | 40 | "user": z.null(), |
| 41 | -}); | |
| 41 | +}).strict(); | |
| 42 | 42 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 43 | 43 | |
| 44 | 44 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +3 −3test/inputs/json/misc/7fbfb.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -17,7 +17,7 @@ export type Value = z.infer<typeof ValueSchema>; | ||
| 17 | 17 | export const CountrySchema = z.object({ |
| 18 | 18 | "id": IdSchema, |
| 19 | 19 | "value": ValueSchema, |
| 20 | -}); | |
| 20 | +}).strict(); | |
| 21 | 21 | export type Country = z.infer<typeof CountrySchema>; |
| 22 | 22 | |
| 23 | 23 | export const FluffyTopLevelSchema = z.object({ |
| @@ -25,7 +25,7 @@ export const FluffyTopLevelSchema = z.object({ | ||
| 25 | 25 | "pages": z.number().int(), |
| 26 | 26 | "per_page": z.string().regex(/^-?\d+$/), |
| 27 | 27 | "total": z.number().int(), |
| 28 | -}); | |
| 28 | +}).strict(); | |
| 29 | 29 | export type FluffyTopLevel = z.infer<typeof FluffyTopLevelSchema>; |
| 30 | 30 | |
| 31 | 31 | export const PurpleTopLevelSchema = z.object({ |
| @@ -34,7 +34,7 @@ export const PurpleTopLevelSchema = z.object({ | ||
| 34 | 34 | "decimal": z.string().regex(/^-?\d+$/), |
| 35 | 35 | "indicator": CountrySchema, |
| 36 | 36 | "value": z.string(), |
| 37 | -}); | |
| 37 | +}).strict(); | |
| 38 | 38 | export type PurpleTopLevel = z.infer<typeof PurpleTopLevelSchema>; |
| 39 | 39 | |
| 40 | 40 | export const TopLevelSchema = z.array(z.union([z.array(PurpleTopLevelSchema), FluffyTopLevelSchema])); |
Test case
1 generated file · +3 −3test/inputs/json/misc/80aff.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -2,7 +2,7 @@ import * as z from "zod"; | ||
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | export const FacetsSchema = z.object({ |
| 5 | -}); | |
| 5 | +}).strict(); | |
| 6 | 6 | export type Facets = z.infer<typeof FacetsSchema>; |
| 7 | 7 | |
| 8 | 8 | export const ResultSchema = z.object({ |
| @@ -13,7 +13,7 @@ export const ResultSchema = z.object({ | ||
| 13 | 13 | "parent": z.union([z.null(), z.number().int()]), |
| 14 | 14 | "updated_at": z.coerce.date(), |
| 15 | 15 | "uri": z.string(), |
| 16 | -}); | |
| 16 | +}).strict(); | |
| 17 | 17 | export type Result = z.infer<typeof ResultSchema>; |
| 18 | 18 | |
| 19 | 19 | export const TopLevelSchema = z.object({ |
| @@ -24,5 +24,5 @@ export const TopLevelSchema = z.object({ | ||
| 24 | 24 | "offset": z.number().int(), |
| 25 | 25 | "previous": z.boolean(), |
| 26 | 26 | "results": z.array(ResultSchema), |
| 27 | -}); | |
| 27 | +}).strict(); | |
| 28 | 28 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/82509.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -3,5 +3,5 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "origin": z.string(), |
| 6 | -}); | |
| 6 | +}).strict(); | |
| 7 | 7 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +8 −8test/inputs/json/misc/8592b.json
Mtypescript-zoddefault / TopLevel.ts+8 −8
| @@ -44,14 +44,14 @@ export const KindSchema = z.enum([ | ||
| 44 | 44 | export type Kind = z.infer<typeof KindSchema>; |
| 45 | 45 | |
| 46 | 46 | export const MediaEmbedSchema = z.object({ |
| 47 | -}); | |
| 47 | +}).strict(); | |
| 48 | 48 | export type MediaEmbed = z.infer<typeof MediaEmbedSchema>; |
| 49 | 49 | |
| 50 | 50 | export const SourceSchema = z.object({ |
| 51 | 51 | "height": z.number().int(), |
| 52 | 52 | "url": z.string(), |
| 53 | 53 | "width": z.number().int(), |
| 54 | -}); | |
| 54 | +}).strict(); | |
| 55 | 55 | export type Source = z.infer<typeof SourceSchema>; |
| 56 | 56 | |
| 57 | 57 | export const ImageSchema = z.object({ |
| @@ -59,13 +59,13 @@ export const ImageSchema = z.object({ | ||
| 59 | 59 | "resolutions": z.array(SourceSchema), |
| 60 | 60 | "source": SourceSchema, |
| 61 | 61 | "variants": MediaEmbedSchema, |
| 62 | -}); | |
| 62 | +}).strict(); | |
| 63 | 63 | export type Image = z.infer<typeof ImageSchema>; |
| 64 | 64 | |
| 65 | 65 | export const PreviewSchema = z.object({ |
| 66 | 66 | "enabled": z.boolean(), |
| 67 | 67 | "images": z.array(ImageSchema), |
| 68 | -}); | |
| 68 | +}).strict(); | |
| 69 | 69 | export type Preview = z.infer<typeof PreviewSchema>; |
| 70 | 70 | |
| 71 | 71 | export const ChildDataSchema = z.object({ |
| @@ -133,13 +133,13 @@ export const ChildDataSchema = z.object({ | ||
| 133 | 133 | "user_reports": z.array(z.any()), |
| 134 | 134 | "view_count": z.null(), |
| 135 | 135 | "visited": z.boolean(), |
| 136 | -}); | |
| 136 | +}).strict(); | |
| 137 | 137 | export type ChildData = z.infer<typeof ChildDataSchema>; |
| 138 | 138 | |
| 139 | 139 | export const ChildSchema = z.object({ |
| 140 | 140 | "data": ChildDataSchema, |
| 141 | 141 | "kind": KindSchema, |
| 142 | -}); | |
| 142 | +}).strict(); | |
| 143 | 143 | export type Child = z.infer<typeof ChildSchema>; |
| 144 | 144 | |
| 145 | 145 | export const TopLevelDataSchema = z.object({ |
| @@ -147,11 +147,11 @@ export const TopLevelDataSchema = z.object({ | ||
| 147 | 147 | "before": z.null(), |
| 148 | 148 | "children": z.array(ChildSchema), |
| 149 | 149 | "modhash": z.string(), |
| 150 | -}); | |
| 150 | +}).strict(); | |
| 151 | 151 | export type TopLevelData = z.infer<typeof TopLevelDataSchema>; |
| 152 | 152 | |
| 153 | 153 | export const TopLevelSchema = z.object({ |
| 154 | 154 | "data": TopLevelDataSchema, |
| 155 | 155 | "kind": z.string(), |
| 156 | -}); | |
| 156 | +}).strict(); | |
| 157 | 157 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +14 −14test/inputs/json/misc/88130.json
Mtypescript-zoddefault / TopLevel.ts+14 −14
| @@ -4,7 +4,7 @@ import * as z from "zod"; | ||
| 4 | 4 | export const AstronomySchema = z.object({ |
| 5 | 5 | "sunrise": z.string(), |
| 6 | 6 | "sunset": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Astronomy = z.infer<typeof AstronomySchema>; |
| 9 | 9 | |
| 10 | 10 | export const AtmosphereSchema = z.object({ |
| @@ -12,7 +12,7 @@ export const AtmosphereSchema = z.object({ | ||
| 12 | 12 | "pressure": z.string(), |
| 13 | 13 | "rising": z.string().regex(/^-?\d+$/), |
| 14 | 14 | "visibility": z.string(), |
| 15 | -}); | |
| 15 | +}).strict(); | |
| 16 | 16 | export type Atmosphere = z.infer<typeof AtmosphereSchema>; |
| 17 | 17 | |
| 18 | 18 | export const ImageSchema = z.object({ |
| @@ -21,7 +21,7 @@ export const ImageSchema = z.object({ | ||
| 21 | 21 | "title": z.string(), |
| 22 | 22 | "url": z.string(), |
| 23 | 23 | "width": z.string().regex(/^-?\d+$/), |
| 24 | -}); | |
| 24 | +}).strict(); | |
| 25 | 25 | export type Image = z.infer<typeof ImageSchema>; |
| 26 | 26 | |
| 27 | 27 | export const ConditionSchema = z.object({ |
| @@ -29,7 +29,7 @@ export const ConditionSchema = z.object({ | ||
| 29 | 29 | "date": z.string(), |
| 30 | 30 | "temp": z.string().regex(/^-?\d+$/), |
| 31 | 31 | "text": z.string(), |
| 32 | -}); | |
| 32 | +}).strict(); | |
| 33 | 33 | export type Condition = z.infer<typeof ConditionSchema>; |
| 34 | 34 | |
| 35 | 35 | export const ForecastSchema = z.object({ |
| @@ -39,19 +39,19 @@ export const ForecastSchema = z.object({ | ||
| 39 | 39 | "high": z.string().regex(/^-?\d+$/), |
| 40 | 40 | "low": z.string().regex(/^-?\d+$/), |
| 41 | 41 | "text": z.string(), |
| 42 | -}); | |
| 42 | +}).strict(); | |
| 43 | 43 | export type Forecast = z.infer<typeof ForecastSchema>; |
| 44 | 44 | |
| 45 | 45 | export const GuidSchema = z.object({ |
| 46 | 46 | "isPermaLink": z.enum(["true", "false"]), |
| 47 | -}); | |
| 47 | +}).strict(); | |
| 48 | 48 | export type Guid = z.infer<typeof GuidSchema>; |
| 49 | 49 | |
| 50 | 50 | export const LocationSchema = z.object({ |
| 51 | 51 | "city": z.string(), |
| 52 | 52 | "country": z.string(), |
| 53 | 53 | "region": z.string(), |
| 54 | -}); | |
| 54 | +}).strict(); | |
| 55 | 55 | export type Location = z.infer<typeof LocationSchema>; |
| 56 | 56 | |
| 57 | 57 | export const UnitsSchema = z.object({ |
| @@ -59,14 +59,14 @@ export const UnitsSchema = z.object({ | ||
| 59 | 59 | "pressure": z.string(), |
| 60 | 60 | "speed": z.string(), |
| 61 | 61 | "temperature": z.string(), |
| 62 | -}); | |
| 62 | +}).strict(); | |
| 63 | 63 | export type Units = z.infer<typeof UnitsSchema>; |
| 64 | 64 | |
| 65 | 65 | export const WindSchema = z.object({ |
| 66 | 66 | "chill": z.string().regex(/^-?\d+$/), |
| 67 | 67 | "direction": z.string().regex(/^-?\d+$/), |
| 68 | 68 | "speed": z.string().regex(/^-?\d+$/), |
| 69 | -}); | |
| 69 | +}).strict(); | |
| 70 | 70 | export type Wind = z.infer<typeof WindSchema>; |
| 71 | 71 | |
| 72 | 72 | export const ItemSchema = z.object({ |
| @@ -79,7 +79,7 @@ export const ItemSchema = z.object({ | ||
| 79 | 79 | "long": z.string(), |
| 80 | 80 | "pubDate": z.string(), |
| 81 | 81 | "title": z.string(), |
| 82 | -}); | |
| 82 | +}).strict(); | |
| 83 | 83 | export type Item = z.infer<typeof ItemSchema>; |
| 84 | 84 | |
| 85 | 85 | export const ChannelSchema = z.object({ |
| @@ -96,12 +96,12 @@ export const ChannelSchema = z.object({ | ||
| 96 | 96 | "ttl": z.string().regex(/^-?\d+$/), |
| 97 | 97 | "units": UnitsSchema, |
| 98 | 98 | "wind": WindSchema, |
| 99 | -}); | |
| 99 | +}).strict(); | |
| 100 | 100 | export type Channel = z.infer<typeof ChannelSchema>; |
| 101 | 101 | |
| 102 | 102 | export const ResultsSchema = z.object({ |
| 103 | 103 | "channel": ChannelSchema, |
| 104 | -}); | |
| 104 | +}).strict(); | |
| 105 | 105 | export type Results = z.infer<typeof ResultsSchema>; |
| 106 | 106 | |
| 107 | 107 | export const QuerySchema = z.object({ |
| @@ -109,10 +109,10 @@ export const QuerySchema = z.object({ | ||
| 109 | 109 | "created": z.coerce.date(), |
| 110 | 110 | "lang": z.string(), |
| 111 | 111 | "results": ResultsSchema, |
| 112 | -}); | |
| 112 | +}).strict(); | |
| 113 | 113 | export type Query = z.infer<typeof QuerySchema>; |
| 114 | 114 | |
| 115 | 115 | export const TopLevelSchema = z.object({ |
| 116 | 116 | "query": QuerySchema, |
| 117 | -}); | |
| 117 | +}).strict(); | |
| 118 | 118 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/json/misc/8a62c.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -4,10 +4,10 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TotalPopulationSchema = z.object({ |
| 5 | 5 | "date": z.string(), |
| 6 | 6 | "population": z.number().int(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type TotalPopulation = z.infer<typeof TotalPopulationSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "total_population": z.array(TotalPopulationSchema), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +3 −3test/inputs/json/misc/908db.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -4,15 +4,15 @@ import * as z from "zod"; | ||
| 4 | 4 | export const StateStateSchema = z.object({ |
| 5 | 5 | "state_id": z.string(), |
| 6 | 6 | "state_name": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type StateState = z.infer<typeof StateStateSchema>; |
| 9 | 9 | |
| 10 | 10 | export const StateElementSchema = z.object({ |
| 11 | 11 | "state": StateStateSchema, |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type StateElement = z.infer<typeof StateElementSchema>; |
| 14 | 14 | |
| 15 | 15 | export const TopLevelSchema = z.object({ |
| 16 | 16 | "states": z.array(StateElementSchema), |
| 17 | -}); | |
| 17 | +}).strict(); | |
| 18 | 18 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/9617f.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -5,5 +5,5 @@ export const TopLevelSchema = z.object({ | ||
| 5 | 5 | "base": z.string(), |
| 6 | 6 | "date": z.string(), |
| 7 | 7 | "rates": z.record(z.string(), z.number()), |
| 8 | -}); | |
| 8 | +}).strict(); | |
| 9 | 9 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/96f7c.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -8,5 +8,5 @@ export const TopLevelSchema = z.object({ | ||
| 8 | 8 | "importer": z.array(z.string()), |
| 9 | 9 | "pages": z.array(z.string()), |
| 10 | 10 | "verifiable_password_authentication": z.boolean(), |
| 11 | -}); | |
| 11 | +}).strict(); | |
| 12 | 12 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/9847b.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -4,7 +4,7 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TopLevelElementSchema = z.object({ |
| 5 | 5 | "id": z.string(), |
| 6 | 6 | "name": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +14 −14test/inputs/json/misc/9929c.json
Mtypescript-zoddefault / TopLevel.ts+14 −14
| @@ -4,7 +4,7 @@ import * as z from "zod"; | ||
| 4 | 4 | export const AstronomySchema = z.object({ |
| 5 | 5 | "sunrise": z.string(), |
| 6 | 6 | "sunset": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Astronomy = z.infer<typeof AstronomySchema>; |
| 9 | 9 | |
| 10 | 10 | export const AtmosphereSchema = z.object({ |
| @@ -12,7 +12,7 @@ export const AtmosphereSchema = z.object({ | ||
| 12 | 12 | "pressure": z.string(), |
| 13 | 13 | "rising": z.string().regex(/^-?\d+$/), |
| 14 | 14 | "visibility": z.string(), |
| 15 | -}); | |
| 15 | +}).strict(); | |
| 16 | 16 | export type Atmosphere = z.infer<typeof AtmosphereSchema>; |
| 17 | 17 | |
| 18 | 18 | export const ImageSchema = z.object({ |
| @@ -21,7 +21,7 @@ export const ImageSchema = z.object({ | ||
| 21 | 21 | "title": z.string(), |
| 22 | 22 | "url": z.string(), |
| 23 | 23 | "width": z.string().regex(/^-?\d+$/), |
| 24 | -}); | |
| 24 | +}).strict(); | |
| 25 | 25 | export type Image = z.infer<typeof ImageSchema>; |
| 26 | 26 | |
| 27 | 27 | export const ConditionSchema = z.object({ |
| @@ -29,7 +29,7 @@ export const ConditionSchema = z.object({ | ||
| 29 | 29 | "date": z.string(), |
| 30 | 30 | "temp": z.string().regex(/^-?\d+$/), |
| 31 | 31 | "text": z.string(), |
| 32 | -}); | |
| 32 | +}).strict(); | |
| 33 | 33 | export type Condition = z.infer<typeof ConditionSchema>; |
| 34 | 34 | |
| 35 | 35 | export const ForecastSchema = z.object({ |
| @@ -39,19 +39,19 @@ export const ForecastSchema = z.object({ | ||
| 39 | 39 | "high": z.string().regex(/^-?\d+$/), |
| 40 | 40 | "low": z.string().regex(/^-?\d+$/), |
| 41 | 41 | "text": z.string(), |
| 42 | -}); | |
| 42 | +}).strict(); | |
| 43 | 43 | export type Forecast = z.infer<typeof ForecastSchema>; |
| 44 | 44 | |
| 45 | 45 | export const GuidSchema = z.object({ |
| 46 | 46 | "isPermaLink": z.enum(["true", "false"]), |
| 47 | -}); | |
| 47 | +}).strict(); | |
| 48 | 48 | export type Guid = z.infer<typeof GuidSchema>; |
| 49 | 49 | |
| 50 | 50 | export const LocationSchema = z.object({ |
| 51 | 51 | "city": z.string(), |
| 52 | 52 | "country": z.string(), |
| 53 | 53 | "region": z.string(), |
| 54 | -}); | |
| 54 | +}).strict(); | |
| 55 | 55 | export type Location = z.infer<typeof LocationSchema>; |
| 56 | 56 | |
| 57 | 57 | export const UnitsSchema = z.object({ |
| @@ -59,14 +59,14 @@ export const UnitsSchema = z.object({ | ||
| 59 | 59 | "pressure": z.string(), |
| 60 | 60 | "speed": z.string(), |
| 61 | 61 | "temperature": z.string(), |
| 62 | -}); | |
| 62 | +}).strict(); | |
| 63 | 63 | export type Units = z.infer<typeof UnitsSchema>; |
| 64 | 64 | |
| 65 | 65 | export const WindSchema = z.object({ |
| 66 | 66 | "chill": z.string().regex(/^-?\d+$/), |
| 67 | 67 | "direction": z.string().regex(/^-?\d+$/), |
| 68 | 68 | "speed": z.string().regex(/^-?\d+$/), |
| 69 | -}); | |
| 69 | +}).strict(); | |
| 70 | 70 | export type Wind = z.infer<typeof WindSchema>; |
| 71 | 71 | |
| 72 | 72 | export const ItemSchema = z.object({ |
| @@ -79,7 +79,7 @@ export const ItemSchema = z.object({ | ||
| 79 | 79 | "long": z.string(), |
| 80 | 80 | "pubDate": z.string(), |
| 81 | 81 | "title": z.string(), |
| 82 | -}); | |
| 82 | +}).strict(); | |
| 83 | 83 | export type Item = z.infer<typeof ItemSchema>; |
| 84 | 84 | |
| 85 | 85 | export const ChannelSchema = z.object({ |
| @@ -96,12 +96,12 @@ export const ChannelSchema = z.object({ | ||
| 96 | 96 | "ttl": z.string().regex(/^-?\d+$/), |
| 97 | 97 | "units": UnitsSchema, |
| 98 | 98 | "wind": WindSchema, |
| 99 | -}); | |
| 99 | +}).strict(); | |
| 100 | 100 | export type Channel = z.infer<typeof ChannelSchema>; |
| 101 | 101 | |
| 102 | 102 | export const ResultsSchema = z.object({ |
| 103 | 103 | "channel": ChannelSchema, |
| 104 | -}); | |
| 104 | +}).strict(); | |
| 105 | 105 | export type Results = z.infer<typeof ResultsSchema>; |
| 106 | 106 | |
| 107 | 107 | export const QuerySchema = z.object({ |
| @@ -109,10 +109,10 @@ export const QuerySchema = z.object({ | ||
| 109 | 109 | "created": z.coerce.date(), |
| 110 | 110 | "lang": z.string(), |
| 111 | 111 | "results": ResultsSchema, |
| 112 | -}); | |
| 112 | +}).strict(); | |
| 113 | 113 | export type Query = z.infer<typeof QuerySchema>; |
| 114 | 114 | |
| 115 | 115 | export const TopLevelSchema = z.object({ |
| 116 | 116 | "query": QuerySchema, |
| 117 | -}); | |
| 117 | +}).strict(); | |
| 118 | 118 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/misc/996bd.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -34,20 +34,20 @@ export type Title = z.infer<typeof TitleSchema>; | ||
| 34 | 34 | export const IdentifierSchema = z.object({ |
| 35 | 35 | "identifier": z.string(), |
| 36 | 36 | "scheme": SchemeSchema, |
| 37 | -}); | |
| 37 | +}).strict(); | |
| 38 | 38 | export type Identifier = z.infer<typeof IdentifierSchema>; |
| 39 | 39 | |
| 40 | 40 | export const LinkSchema = z.object({ |
| 41 | 41 | "note": z.string(), |
| 42 | 42 | "url": z.string(), |
| 43 | -}); | |
| 43 | +}).strict(); | |
| 44 | 44 | export type Link = z.infer<typeof LinkSchema>; |
| 45 | 45 | |
| 46 | 46 | export const TextSchema = z.object({ |
| 47 | 47 | "media_type": MediaTypeSchema, |
| 48 | 48 | "title": TitleSchema, |
| 49 | 49 | "url": z.string(), |
| 50 | -}); | |
| 50 | +}).strict(); | |
| 51 | 51 | export type Text = z.infer<typeof TextSchema>; |
| 52 | 52 | |
| 53 | 53 | export const TopLevelElementSchema = z.object({ |
| @@ -59,7 +59,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 59 | 59 | "other_names": z.array(z.any()), |
| 60 | 60 | "superseded_by": z.union([z.null(), z.string()]), |
| 61 | 61 | "text": z.array(TextSchema), |
| 62 | -}); | |
| 62 | +}).strict(); | |
| 63 | 63 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 64 | 64 | |
| 65 | 65 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +4 −4test/inputs/json/misc/9a503.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -11,20 +11,20 @@ export type Keyword = z.infer<typeof KeywordSchema>; | ||
| 11 | 11 | export const IdentifierSchema = z.object({ |
| 12 | 12 | "identifier": z.string(), |
| 13 | 13 | "scheme": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Identifier = z.infer<typeof IdentifierSchema>; |
| 16 | 16 | |
| 17 | 17 | export const LinkSchema = z.object({ |
| 18 | 18 | "note": z.string(), |
| 19 | 19 | "url": z.string(), |
| 20 | -}); | |
| 20 | +}).strict(); | |
| 21 | 21 | export type Link = z.infer<typeof LinkSchema>; |
| 22 | 22 | |
| 23 | 23 | export const TextSchema = z.object({ |
| 24 | 24 | "media_type": z.string(), |
| 25 | 25 | "title": z.string(), |
| 26 | 26 | "url": z.string(), |
| 27 | -}); | |
| 27 | +}).strict(); | |
| 28 | 28 | export type Text = z.infer<typeof TextSchema>; |
| 29 | 29 | |
| 30 | 30 | export const TopLevelElementSchema = z.object({ |
| @@ -36,7 +36,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 36 | 36 | "other_names": z.array(z.any()), |
| 37 | 37 | "superseded_by": z.null(), |
| 38 | 38 | "text": z.array(TextSchema), |
| 39 | -}); | |
| 39 | +}).strict(); | |
| 40 | 40 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 41 | 41 | |
| 42 | 42 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +3 −3test/inputs/json/misc/9ac3b.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -15,7 +15,7 @@ export const TitleSchema = z.enum([ | ||
| 15 | 15 | export type Title = z.infer<typeof TitleSchema>; |
| 16 | 16 | |
| 17 | 17 | export const FacetsSchema = z.object({ |
| 18 | -}); | |
| 18 | +}).strict(); | |
| 19 | 19 | export type Facets = z.infer<typeof FacetsSchema>; |
| 20 | 20 | |
| 21 | 21 | export const ResultSchema = z.object({ |
| @@ -30,7 +30,7 @@ export const ResultSchema = z.object({ | ||
| 30 | 30 | "title": z.union([z.null(), TitleSchema]), |
| 31 | 31 | "updated_at": z.coerce.date(), |
| 32 | 32 | "uri": z.string(), |
| 33 | -}); | |
| 33 | +}).strict(); | |
| 34 | 34 | export type Result = z.infer<typeof ResultSchema>; |
| 35 | 35 | |
| 36 | 36 | export const TopLevelSchema = z.object({ |
| @@ -41,5 +41,5 @@ export const TopLevelSchema = z.object({ | ||
| 41 | 41 | "offset": z.number().int(), |
| 42 | 42 | "previous": z.boolean(), |
| 43 | 43 | "results": z.array(ResultSchema), |
| 44 | -}); | |
| 44 | +}).strict(); | |
| 45 | 45 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/misc/9eed5.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -10,20 +10,20 @@ export type Keyword = z.infer<typeof KeywordSchema>; | ||
| 10 | 10 | export const IdentifierSchema = z.object({ |
| 11 | 11 | "identifier": z.string(), |
| 12 | 12 | "scheme": z.string(), |
| 13 | -}); | |
| 13 | +}).strict(); | |
| 14 | 14 | export type Identifier = z.infer<typeof IdentifierSchema>; |
| 15 | 15 | |
| 16 | 16 | export const LinkSchema = z.object({ |
| 17 | 17 | "note": z.string(), |
| 18 | 18 | "url": z.string(), |
| 19 | -}); | |
| 19 | +}).strict(); | |
| 20 | 20 | export type Link = z.infer<typeof LinkSchema>; |
| 21 | 21 | |
| 22 | 22 | export const TextSchema = z.object({ |
| 23 | 23 | "media_type": z.string(), |
| 24 | 24 | "title": z.string(), |
| 25 | 25 | "url": z.string(), |
| 26 | -}); | |
| 26 | +}).strict(); | |
| 27 | 27 | export type Text = z.infer<typeof TextSchema>; |
| 28 | 28 | |
| 29 | 29 | export const TopLevelElementSchema = z.object({ |
| @@ -35,7 +35,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 35 | 35 | "other_names": z.array(z.any()), |
| 36 | 36 | "superseded_by": z.null(), |
| 37 | 37 | "text": z.array(TextSchema), |
| 38 | -}); | |
| 38 | +}).strict(); | |
| 39 | 39 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 40 | 40 | |
| 41 | 41 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +2 −2test/inputs/json/misc/a0496.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -2,7 +2,7 @@ import * as z from "zod"; | ||
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | export const ErrorsSchema = z.object({ |
| 5 | -}); | |
| 5 | +}).strict(); | |
| 6 | 6 | export type Errors = z.infer<typeof ErrorsSchema>; |
| 7 | 7 | |
| 8 | 8 | export const TopLevelSchema = z.object({ |
| @@ -23,5 +23,5 @@ export const TopLevelSchema = z.object({ | ||
| 23 | 23 | "type": z.string(), |
| 24 | 24 | "updated_at": z.coerce.date(), |
| 25 | 25 | "urlize_name": z.string(), |
| 26 | -}); | |
| 26 | +}).strict(); | |
| 27 | 27 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +14 −14test/inputs/json/misc/a1eca.json
Mtypescript-zoddefault / TopLevel.ts+14 −14
| @@ -4,7 +4,7 @@ import * as z from "zod"; | ||
| 4 | 4 | export const AstronomySchema = z.object({ |
| 5 | 5 | "sunrise": z.string(), |
| 6 | 6 | "sunset": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Astronomy = z.infer<typeof AstronomySchema>; |
| 9 | 9 | |
| 10 | 10 | export const AtmosphereSchema = z.object({ |
| @@ -12,7 +12,7 @@ export const AtmosphereSchema = z.object({ | ||
| 12 | 12 | "pressure": z.string(), |
| 13 | 13 | "rising": z.string().regex(/^-?\d+$/), |
| 14 | 14 | "visibility": z.string(), |
| 15 | -}); | |
| 15 | +}).strict(); | |
| 16 | 16 | export type Atmosphere = z.infer<typeof AtmosphereSchema>; |
| 17 | 17 | |
| 18 | 18 | export const ImageSchema = z.object({ |
| @@ -21,7 +21,7 @@ export const ImageSchema = z.object({ | ||
| 21 | 21 | "title": z.string(), |
| 22 | 22 | "url": z.string(), |
| 23 | 23 | "width": z.string().regex(/^-?\d+$/), |
| 24 | -}); | |
| 24 | +}).strict(); | |
| 25 | 25 | export type Image = z.infer<typeof ImageSchema>; |
| 26 | 26 | |
| 27 | 27 | export const ConditionSchema = z.object({ |
| @@ -29,7 +29,7 @@ export const ConditionSchema = z.object({ | ||
| 29 | 29 | "date": z.string(), |
| 30 | 30 | "temp": z.string().regex(/^-?\d+$/), |
| 31 | 31 | "text": z.string(), |
| 32 | -}); | |
| 32 | +}).strict(); | |
| 33 | 33 | export type Condition = z.infer<typeof ConditionSchema>; |
| 34 | 34 | |
| 35 | 35 | export const ForecastSchema = z.object({ |
| @@ -39,19 +39,19 @@ export const ForecastSchema = z.object({ | ||
| 39 | 39 | "high": z.string().regex(/^-?\d+$/), |
| 40 | 40 | "low": z.string().regex(/^-?\d+$/), |
| 41 | 41 | "text": z.string(), |
| 42 | -}); | |
| 42 | +}).strict(); | |
| 43 | 43 | export type Forecast = z.infer<typeof ForecastSchema>; |
| 44 | 44 | |
| 45 | 45 | export const GuidSchema = z.object({ |
| 46 | 46 | "isPermaLink": z.enum(["true", "false"]), |
| 47 | -}); | |
| 47 | +}).strict(); | |
| 48 | 48 | export type Guid = z.infer<typeof GuidSchema>; |
| 49 | 49 | |
| 50 | 50 | export const LocationSchema = z.object({ |
| 51 | 51 | "city": z.string(), |
| 52 | 52 | "country": z.string(), |
| 53 | 53 | "region": z.string(), |
| 54 | -}); | |
| 54 | +}).strict(); | |
| 55 | 55 | export type Location = z.infer<typeof LocationSchema>; |
| 56 | 56 | |
| 57 | 57 | export const UnitsSchema = z.object({ |
| @@ -59,14 +59,14 @@ export const UnitsSchema = z.object({ | ||
| 59 | 59 | "pressure": z.string(), |
| 60 | 60 | "speed": z.string(), |
| 61 | 61 | "temperature": z.string(), |
| 62 | -}); | |
| 62 | +}).strict(); | |
| 63 | 63 | export type Units = z.infer<typeof UnitsSchema>; |
| 64 | 64 | |
| 65 | 65 | export const WindSchema = z.object({ |
| 66 | 66 | "chill": z.string().regex(/^-?\d+$/), |
| 67 | 67 | "direction": z.string().regex(/^-?\d+$/), |
| 68 | 68 | "speed": z.string().regex(/^-?\d+$/), |
| 69 | -}); | |
| 69 | +}).strict(); | |
| 70 | 70 | export type Wind = z.infer<typeof WindSchema>; |
| 71 | 71 | |
| 72 | 72 | export const ItemSchema = z.object({ |
| @@ -79,7 +79,7 @@ export const ItemSchema = z.object({ | ||
| 79 | 79 | "long": z.string(), |
| 80 | 80 | "pubDate": z.string(), |
| 81 | 81 | "title": z.string(), |
| 82 | -}); | |
| 82 | +}).strict(); | |
| 83 | 83 | export type Item = z.infer<typeof ItemSchema>; |
| 84 | 84 | |
| 85 | 85 | export const ChannelSchema = z.object({ |
| @@ -96,12 +96,12 @@ export const ChannelSchema = z.object({ | ||
| 96 | 96 | "ttl": z.string().regex(/^-?\d+$/), |
| 97 | 97 | "units": UnitsSchema, |
| 98 | 98 | "wind": WindSchema, |
| 99 | -}); | |
| 99 | +}).strict(); | |
| 100 | 100 | export type Channel = z.infer<typeof ChannelSchema>; |
| 101 | 101 | |
| 102 | 102 | export const ResultsSchema = z.object({ |
| 103 | 103 | "channel": ChannelSchema, |
| 104 | -}); | |
| 104 | +}).strict(); | |
| 105 | 105 | export type Results = z.infer<typeof ResultsSchema>; |
| 106 | 106 | |
| 107 | 107 | export const QuerySchema = z.object({ |
| @@ -109,10 +109,10 @@ export const QuerySchema = z.object({ | ||
| 109 | 109 | "created": z.coerce.date(), |
| 110 | 110 | "lang": z.string(), |
| 111 | 111 | "results": ResultsSchema, |
| 112 | -}); | |
| 112 | +}).strict(); | |
| 113 | 113 | export type Query = z.infer<typeof QuerySchema>; |
| 114 | 114 | |
| 115 | 115 | export const TopLevelSchema = z.object({ |
| 116 | 116 | "query": QuerySchema, |
| 117 | -}); | |
| 117 | +}).strict(); | |
| 118 | 118 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +13 −13test/inputs/json/misc/a3d8c.json
Mtypescript-zoddefault / TopLevel.ts+13 −13
| @@ -11,35 +11,35 @@ export type TypeName = z.infer<typeof TypeNameSchema>; | ||
| 11 | 11 | export const TopSchema = z.object({ |
| 12 | 12 | "count": z.number().int(), |
| 13 | 13 | "item": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Top = z.infer<typeof TopSchema>; |
| 16 | 16 | |
| 17 | 17 | export const QuerySchema = z.object({ |
| 18 | -}); | |
| 18 | +}).strict(); | |
| 19 | 19 | export type Query = z.infer<typeof QuerySchema>; |
| 20 | 20 | |
| 21 | 21 | export const GrantSchema = z.object({ |
| 22 | 22 | "flags": z.array(z.string()), |
| 23 | 23 | "inherited": z.boolean(), |
| 24 | 24 | "type": z.string(), |
| 25 | -}); | |
| 25 | +}).strict(); | |
| 26 | 26 | export type Grant = z.infer<typeof GrantSchema>; |
| 27 | 27 | |
| 28 | 28 | export const LicenseSchema = z.object({ |
| 29 | 29 | "name": z.string(), |
| 30 | -}); | |
| 30 | +}).strict(); | |
| 31 | 31 | export type License = z.infer<typeof LicenseSchema>; |
| 32 | 32 | |
| 33 | 33 | export const VisibleSchema = z.object({ |
| 34 | 34 | "table": z.boolean(), |
| 35 | -}); | |
| 35 | +}).strict(); | |
| 36 | 36 | export type Visible = z.infer<typeof VisibleSchema>; |
| 37 | 37 | |
| 38 | 38 | export const OwnerSchema = z.object({ |
| 39 | 39 | "displayName": z.string(), |
| 40 | 40 | "id": z.string(), |
| 41 | 41 | "screenName": z.string(), |
| 42 | -}); | |
| 42 | +}).strict(); | |
| 43 | 43 | export type Owner = z.infer<typeof OwnerSchema>; |
| 44 | 44 | |
| 45 | 45 | export const CachedContentsSchema = z.object({ |
| @@ -50,12 +50,12 @@ export const CachedContentsSchema = z.object({ | ||
| 50 | 50 | "smallest": z.string(), |
| 51 | 51 | "sum": z.string().regex(/^-?\d+$/).optional(), |
| 52 | 52 | "top": z.array(TopSchema), |
| 53 | -}); | |
| 53 | +}).strict(); | |
| 54 | 54 | export type CachedContents = z.infer<typeof CachedContentsSchema>; |
| 55 | 55 | |
| 56 | 56 | export const RenderTypeConfigSchema = z.object({ |
| 57 | 57 | "visible": VisibleSchema, |
| 58 | -}); | |
| 58 | +}).strict(); | |
| 59 | 59 | export type RenderTypeConfig = z.infer<typeof RenderTypeConfigSchema>; |
| 60 | 60 | |
| 61 | 61 | export const ColumnSchema = z.object({ |
| @@ -70,7 +70,7 @@ export const ColumnSchema = z.object({ | ||
| 70 | 70 | "renderTypeName": TypeNameSchema, |
| 71 | 71 | "tableColumnId": z.number().int().optional(), |
| 72 | 72 | "width": z.number().int().optional(), |
| 73 | -}); | |
| 73 | +}).strict(); | |
| 74 | 74 | export type Column = z.infer<typeof ColumnSchema>; |
| 75 | 75 | |
| 76 | 76 | export const MetadataSchema = z.object({ |
| @@ -79,7 +79,7 @@ export const MetadataSchema = z.object({ | ||
| 79 | 79 | "rdfSubject": z.string().regex(/^-?\d+$/), |
| 80 | 80 | "renderTypeConfig": RenderTypeConfigSchema, |
| 81 | 81 | "rowIdentifier": z.string().regex(/^-?\d+$/), |
| 82 | -}); | |
| 82 | +}).strict(); | |
| 83 | 83 | export type Metadata = z.infer<typeof MetadataSchema>; |
| 84 | 84 | |
| 85 | 85 | export const ViewSchema = z.object({ |
| @@ -120,16 +120,16 @@ export const ViewSchema = z.object({ | ||
| 120 | 120 | "viewCount": z.number().int(), |
| 121 | 121 | "viewLastModified": z.number().int(), |
| 122 | 122 | "viewType": z.string(), |
| 123 | -}); | |
| 123 | +}).strict(); | |
| 124 | 124 | export type View = z.infer<typeof ViewSchema>; |
| 125 | 125 | |
| 126 | 126 | export const MetaSchema = z.object({ |
| 127 | 127 | "view": ViewSchema, |
| 128 | -}); | |
| 128 | +}).strict(); | |
| 129 | 129 | export type Meta = z.infer<typeof MetaSchema>; |
| 130 | 130 | |
| 131 | 131 | export const TopLevelSchema = z.object({ |
| 132 | 132 | "data": z.array(z.array(z.union([z.null(), z.number().int(), z.string()]))), |
| 133 | 133 | "meta": MetaSchema, |
| 134 | -}); | |
| 134 | +}).strict(); | |
| 135 | 135 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/a45b0.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -13,7 +13,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 13 | 13 | "males": z.number().int(), |
| 14 | 14 | "total": z.number().int(), |
| 15 | 15 | "year": z.number().int(), |
| 16 | -}); | |
| 16 | +}).strict(); | |
| 17 | 17 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 18 | 18 | |
| 19 | 19 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +4 −4test/inputs/json/misc/a71df.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -11,14 +11,14 @@ export const StatusSchema = z.object({ | ||
| 11 | 11 | "reason": z.string(), |
| 12 | 12 | "trend": z.string(), |
| 13 | 13 | "type": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Status = z.infer<typeof StatusSchema>; |
| 16 | 16 | |
| 17 | 17 | export const MetaSchema = z.object({ |
| 18 | 18 | "credit": z.string(), |
| 19 | 19 | "updated": z.string(), |
| 20 | 20 | "url": z.string(), |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type Meta = z.infer<typeof MetaSchema>; |
| 23 | 23 | |
| 24 | 24 | export const WeatherSchema = z.object({ |
| @@ -27,7 +27,7 @@ export const WeatherSchema = z.object({ | ||
| 27 | 27 | "visibility": z.number(), |
| 28 | 28 | "weather": z.string(), |
| 29 | 29 | "wind": z.string(), |
| 30 | -}); | |
| 30 | +}).strict(); | |
| 31 | 31 | export type Weather = z.infer<typeof WeatherSchema>; |
| 32 | 32 | |
| 33 | 33 | export const TopLevelSchema = z.object({ |
| @@ -39,5 +39,5 @@ export const TopLevelSchema = z.object({ | ||
| 39 | 39 | "state": z.string(), |
| 40 | 40 | "status": StatusSchema, |
| 41 | 41 | "weather": WeatherSchema, |
| 42 | -}); | |
| 42 | +}).strict(); | |
| 43 | 43 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/a9691.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -5,5 +5,5 @@ export const TopLevelSchema = z.object({ | ||
| 5 | 5 | "base": z.string(), |
| 6 | 6 | "date": z.string(), |
| 7 | 7 | "rates": z.record(z.string(), z.number()), |
| 8 | -}); | |
| 8 | +}).strict(); | |
| 9 | 9 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/ab0d1.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -13,7 +13,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 13 | 13 | "males": z.number().int(), |
| 14 | 14 | "total": z.number().int(), |
| 15 | 15 | "year": z.number().int(), |
| 16 | -}); | |
| 16 | +}).strict(); | |
| 17 | 17 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 18 | 18 | |
| 19 | 19 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +2 −2test/inputs/json/misc/abb4b.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -4,10 +4,10 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TotalPopulationSchema = z.object({ |
| 5 | 5 | "date": z.string(), |
| 6 | 6 | "population": z.number().int(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type TotalPopulation = z.infer<typeof TotalPopulationSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "total_population": z.array(TotalPopulationSchema), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/ac944.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -5,5 +5,5 @@ export const TopLevelSchema = z.object({ | ||
| 5 | 5 | "base": z.string(), |
| 6 | 6 | "date": z.string(), |
| 7 | 7 | "rates": z.record(z.string(), z.number()), |
| 8 | -}); | |
| 8 | +}).strict(); | |
| 9 | 9 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +5 −5test/inputs/json/misc/ad8be.json
Mtypescript-zoddefault / TopLevel.ts+5 −5
| @@ -55,26 +55,26 @@ export type Title = z.infer<typeof TitleSchema>; | ||
| 55 | 55 | export const IdentifierSchema = z.object({ |
| 56 | 56 | "identifier": z.string(), |
| 57 | 57 | "scheme": SchemeSchema, |
| 58 | -}); | |
| 58 | +}).strict(); | |
| 59 | 59 | export type Identifier = z.infer<typeof IdentifierSchema>; |
| 60 | 60 | |
| 61 | 61 | export const LinkSchema = z.object({ |
| 62 | 62 | "note": NoteSchema, |
| 63 | 63 | "url": z.string(), |
| 64 | -}); | |
| 64 | +}).strict(); | |
| 65 | 65 | export type Link = z.infer<typeof LinkSchema>; |
| 66 | 66 | |
| 67 | 67 | export const OtherNameSchema = z.object({ |
| 68 | 68 | "name": z.string(), |
| 69 | 69 | "note": z.union([z.null(), z.string()]), |
| 70 | -}); | |
| 70 | +}).strict(); | |
| 71 | 71 | export type OtherName = z.infer<typeof OtherNameSchema>; |
| 72 | 72 | |
| 73 | 73 | export const TextSchema = z.object({ |
| 74 | 74 | "media_type": MediaTypeSchema, |
| 75 | 75 | "title": TitleSchema, |
| 76 | 76 | "url": z.string(), |
| 77 | -}); | |
| 77 | +}).strict(); | |
| 78 | 78 | export type Text = z.infer<typeof TextSchema>; |
| 79 | 79 | |
| 80 | 80 | export const TopLevelElementSchema = z.object({ |
| @@ -86,7 +86,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 86 | 86 | "other_names": z.array(OtherNameSchema), |
| 87 | 87 | "superseded_by": z.union([z.null(), z.string()]), |
| 88 | 88 | "text": z.array(TextSchema), |
| 89 | -}); | |
| 89 | +}).strict(); | |
| 90 | 90 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 91 | 91 | |
| 92 | 92 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +5 −5test/inputs/json/misc/ae7f0.json
Mtypescript-zoddefault / TopLevel.ts+5 −5
| @@ -37,7 +37,7 @@ export const KindSchema = z.enum([ | ||
| 37 | 37 | export type Kind = z.infer<typeof KindSchema>; |
| 38 | 38 | |
| 39 | 39 | export const MediaEmbedSchema = z.object({ |
| 40 | -}); | |
| 40 | +}).strict(); | |
| 41 | 41 | export type MediaEmbed = z.infer<typeof MediaEmbedSchema>; |
| 42 | 42 | |
| 43 | 43 | export const ChildDataSchema = z.object({ |
| @@ -101,13 +101,13 @@ export const ChildDataSchema = z.object({ | ||
| 101 | 101 | "user_reports": z.array(z.any()), |
| 102 | 102 | "view_count": z.null(), |
| 103 | 103 | "visited": z.boolean(), |
| 104 | -}); | |
| 104 | +}).strict(); | |
| 105 | 105 | export type ChildData = z.infer<typeof ChildDataSchema>; |
| 106 | 106 | |
| 107 | 107 | export const ChildSchema = z.object({ |
| 108 | 108 | "data": ChildDataSchema, |
| 109 | 109 | "kind": KindSchema, |
| 110 | -}); | |
| 110 | +}).strict(); | |
| 111 | 111 | export type Child = z.infer<typeof ChildSchema>; |
| 112 | 112 | |
| 113 | 113 | export const TopLevelDataSchema = z.object({ |
| @@ -115,11 +115,11 @@ export const TopLevelDataSchema = z.object({ | ||
| 115 | 115 | "before": z.null(), |
| 116 | 116 | "children": z.array(ChildSchema), |
| 117 | 117 | "modhash": z.string(), |
| 118 | -}); | |
| 118 | +}).strict(); | |
| 119 | 119 | export type TopLevelData = z.infer<typeof TopLevelDataSchema>; |
| 120 | 120 | |
| 121 | 121 | export const TopLevelSchema = z.object({ |
| 122 | 122 | "data": TopLevelDataSchema, |
| 123 | 123 | "kind": z.string(), |
| 124 | -}); | |
| 124 | +}).strict(); | |
| 125 | 125 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/misc/ae9ca.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -38,7 +38,7 @@ export type FeatureType = z.infer<typeof FeatureTypeSchema>; | ||
| 38 | 38 | export const GeometrySchema = z.object({ |
| 39 | 39 | "coordinates": z.array(z.number()), |
| 40 | 40 | "type": GeometryTypeSchema, |
| 41 | -}); | |
| 41 | +}).strict(); | |
| 42 | 42 | export type Geometry = z.infer<typeof GeometrySchema>; |
| 43 | 43 | |
| 44 | 44 | export const PropertiesSchema = z.object({ |
| @@ -52,19 +52,19 @@ export const PropertiesSchema = z.object({ | ||
| 52 | 52 | "Number": z.string().regex(/^-?\d+$/), |
| 53 | 53 | "Site Name": z.string(), |
| 54 | 54 | "Ward": WardSchema, |
| 55 | -}); | |
| 55 | +}).strict(); | |
| 56 | 56 | export type Properties = z.infer<typeof PropertiesSchema>; |
| 57 | 57 | |
| 58 | 58 | export const FeatureSchema = z.object({ |
| 59 | 59 | "geometry": GeometrySchema, |
| 60 | 60 | "properties": PropertiesSchema, |
| 61 | 61 | "type": FeatureTypeSchema, |
| 62 | -}); | |
| 62 | +}).strict(); | |
| 63 | 63 | export type Feature = z.infer<typeof FeatureSchema>; |
| 64 | 64 | |
| 65 | 65 | export const TopLevelSchema = z.object({ |
| 66 | 66 | "features": z.array(FeatureSchema), |
| 67 | 67 | "name": z.string(), |
| 68 | 68 | "type": z.string(), |
| 69 | -}); | |
| 69 | +}).strict(); | |
| 70 | 70 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +6 −6test/inputs/json/misc/af2d1.json
Mtypescript-zoddefault / TopLevel.ts+6 −6
| @@ -74,13 +74,13 @@ export type FeatureType = z.infer<typeof FeatureTypeSchema>; | ||
| 74 | 74 | |
| 75 | 75 | export const CrsPropertiesSchema = z.object({ |
| 76 | 76 | "name": z.string(), |
| 77 | -}); | |
| 77 | +}).strict(); | |
| 78 | 78 | export type CrsProperties = z.infer<typeof CrsPropertiesSchema>; |
| 79 | 79 | |
| 80 | 80 | export const GeometrySchema = z.object({ |
| 81 | 81 | "coordinates": z.array(z.array(z.array(z.array(z.number())))), |
| 82 | 82 | "type": GeometryTypeSchema, |
| 83 | -}); | |
| 83 | +}).strict(); | |
| 84 | 84 | export type Geometry = z.infer<typeof GeometrySchema>; |
| 85 | 85 | |
| 86 | 86 | export const FeaturePropertiesSchema = z.object({ |
| @@ -122,13 +122,13 @@ export const FeaturePropertiesSchema = z.object({ | ||
| 122 | 122 | "update_dat": z.string(), |
| 123 | 123 | "updatedate": z.null(), |
| 124 | 124 | "updateuser": z.null(), |
| 125 | -}); | |
| 125 | +}).strict(); | |
| 126 | 126 | export type FeatureProperties = z.infer<typeof FeaturePropertiesSchema>; |
| 127 | 127 | |
| 128 | 128 | export const CrsSchema = z.object({ |
| 129 | 129 | "properties": CrsPropertiesSchema, |
| 130 | 130 | "type": z.string(), |
| 131 | -}); | |
| 131 | +}).strict(); | |
| 132 | 132 | export type Crs = z.infer<typeof CrsSchema>; |
| 133 | 133 | |
| 134 | 134 | export const FeatureSchema = z.object({ |
| @@ -137,7 +137,7 @@ export const FeatureSchema = z.object({ | ||
| 137 | 137 | "id": z.string(), |
| 138 | 138 | "properties": FeaturePropertiesSchema, |
| 139 | 139 | "type": FeatureTypeSchema, |
| 140 | -}); | |
| 140 | +}).strict(); | |
| 141 | 141 | export type Feature = z.infer<typeof FeatureSchema>; |
| 142 | 142 | |
| 143 | 143 | export const TopLevelSchema = z.object({ |
| @@ -145,5 +145,5 @@ export const TopLevelSchema = z.object({ | ||
| 145 | 145 | "features": z.array(FeatureSchema), |
| 146 | 146 | "totalFeatures": z.number().int(), |
| 147 | 147 | "type": z.string(), |
| 148 | -}); | |
| 148 | +}).strict(); | |
| 149 | 149 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/json/misc/b4865.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -22,7 +22,7 @@ export type Nametype = z.infer<typeof NametypeSchema>; | ||
| 22 | 22 | export const GeolocationSchema = z.object({ |
| 23 | 23 | "coordinates": z.array(z.number()), |
| 24 | 24 | "type": TypeSchema, |
| 25 | -}); | |
| 25 | +}).strict(); | |
| 26 | 26 | export type Geolocation = z.infer<typeof GeolocationSchema>; |
| 27 | 27 | |
| 28 | 28 | export const TopLevelElementSchema = z.object({ |
| @@ -38,7 +38,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 38 | 38 | "reclat": z.string().optional(), |
| 39 | 39 | "reclong": z.string().optional(), |
| 40 | 40 | "year": z.coerce.date().optional(), |
| 41 | -}); | |
| 41 | +}).strict(); | |
| 42 | 42 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 43 | 43 | |
| 44 | 44 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +2 −2test/inputs/json/misc/b6f2c.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -4,10 +4,10 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TotalPopulationSchema = z.object({ |
| 5 | 5 | "date": z.string(), |
| 6 | 6 | "population": z.number().int(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type TotalPopulation = z.infer<typeof TotalPopulationSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "total_population": z.array(TotalPopulationSchema), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/b6fe5.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -6,5 +6,5 @@ export const TopLevelSchema = z.object({ | ||
| 6 | 6 | "movie": z.string(), |
| 7 | 7 | "movie-image": z.string(), |
| 8 | 8 | "theater": z.string(), |
| 9 | -}); | |
| 9 | +}).strict(); | |
| 10 | 10 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/b9f64.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -3,5 +3,5 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "user-agent": z.string(), |
| 6 | -}); | |
| 6 | +}).strict(); | |
| 7 | 7 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/json/misc/bb1ec.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -4,10 +4,10 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TotalPopulationSchema = z.object({ |
| 5 | 5 | "date": z.string(), |
| 6 | 6 | "population": z.number().int(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type TotalPopulation = z.infer<typeof TotalPopulationSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "total_population": z.array(TotalPopulationSchema), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +12 −12test/inputs/json/misc/be234.json
Mtypescript-zoddefault / TopLevel.ts+12 −12
| @@ -61,7 +61,7 @@ export const OembedSchema = z.object({ | ||
| 61 | 61 | "type": z.string(), |
| 62 | 62 | "version": z.string(), |
| 63 | 63 | "width": z.number().int(), |
| 64 | -}); | |
| 64 | +}).strict(); | |
| 65 | 65 | export type Oembed = z.infer<typeof OembedSchema>; |
| 66 | 66 | |
| 67 | 67 | export const MediaEmbedSchema = z.object({ |
| @@ -69,32 +69,32 @@ export const MediaEmbedSchema = z.object({ | ||
| 69 | 69 | "height": z.number().int().optional(), |
| 70 | 70 | "scrolling": z.boolean().optional(), |
| 71 | 71 | "width": z.number().int().optional(), |
| 72 | -}); | |
| 72 | +}).strict(); | |
| 73 | 73 | export type MediaEmbed = z.infer<typeof MediaEmbedSchema>; |
| 74 | 74 | |
| 75 | 75 | export const SourceSchema = z.object({ |
| 76 | 76 | "height": z.number().int(), |
| 77 | 77 | "url": z.string(), |
| 78 | 78 | "width": z.number().int(), |
| 79 | -}); | |
| 79 | +}).strict(); | |
| 80 | 80 | export type Source = z.infer<typeof SourceSchema>; |
| 81 | 81 | |
| 82 | 82 | export const GifSchema = z.object({ |
| 83 | 83 | "resolutions": z.array(SourceSchema), |
| 84 | 84 | "source": SourceSchema, |
| 85 | -}); | |
| 85 | +}).strict(); | |
| 86 | 86 | export type Gif = z.infer<typeof GifSchema>; |
| 87 | 87 | |
| 88 | 88 | export const MediaSchema = z.object({ |
| 89 | 89 | "oembed": OembedSchema, |
| 90 | 90 | "type": DomainSchema, |
| 91 | -}); | |
| 91 | +}).strict(); | |
| 92 | 92 | export type Media = z.infer<typeof MediaSchema>; |
| 93 | 93 | |
| 94 | 94 | export const VariantsSchema = z.object({ |
| 95 | 95 | "gif": GifSchema.optional(), |
| 96 | 96 | "mp4": GifSchema.optional(), |
| 97 | -}); | |
| 97 | +}).strict(); | |
| 98 | 98 | export type Variants = z.infer<typeof VariantsSchema>; |
| 99 | 99 | |
| 100 | 100 | export const ImageSchema = z.object({ |
| @@ -102,13 +102,13 @@ export const ImageSchema = z.object({ | ||
| 102 | 102 | "resolutions": z.array(SourceSchema), |
| 103 | 103 | "source": SourceSchema, |
| 104 | 104 | "variants": VariantsSchema, |
| 105 | -}); | |
| 105 | +}).strict(); | |
| 106 | 106 | export type Image = z.infer<typeof ImageSchema>; |
| 107 | 107 | |
| 108 | 108 | export const PreviewSchema = z.object({ |
| 109 | 109 | "enabled": z.boolean(), |
| 110 | 110 | "images": z.array(ImageSchema), |
| 111 | -}); | |
| 111 | +}).strict(); | |
| 112 | 112 | export type Preview = z.infer<typeof PreviewSchema>; |
| 113 | 113 | |
| 114 | 114 | export const ChildDataSchema = z.object({ |
| @@ -176,13 +176,13 @@ export const ChildDataSchema = z.object({ | ||
| 176 | 176 | "user_reports": z.array(z.any()), |
| 177 | 177 | "view_count": z.null(), |
| 178 | 178 | "visited": z.boolean(), |
| 179 | -}); | |
| 179 | +}).strict(); | |
| 180 | 180 | export type ChildData = z.infer<typeof ChildDataSchema>; |
| 181 | 181 | |
| 182 | 182 | export const ChildSchema = z.object({ |
| 183 | 183 | "data": ChildDataSchema, |
| 184 | 184 | "kind": KindSchema, |
| 185 | -}); | |
| 185 | +}).strict(); | |
| 186 | 186 | export type Child = z.infer<typeof ChildSchema>; |
| 187 | 187 | |
| 188 | 188 | export const TopLevelDataSchema = z.object({ |
| @@ -190,11 +190,11 @@ export const TopLevelDataSchema = z.object({ | ||
| 190 | 190 | "before": z.null(), |
| 191 | 191 | "children": z.array(ChildSchema), |
| 192 | 192 | "modhash": z.string(), |
| 193 | -}); | |
| 193 | +}).strict(); | |
| 194 | 194 | export type TopLevelData = z.infer<typeof TopLevelDataSchema>; |
| 195 | 195 | |
| 196 | 196 | export const TopLevelSchema = z.object({ |
| 197 | 197 | "data": TopLevelDataSchema, |
| 198 | 198 | "kind": z.string(), |
| 199 | -}); | |
| 199 | +}).strict(); | |
| 200 | 200 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +3 −3test/inputs/json/misc/c0356.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -4,18 +4,18 @@ import * as z from "zod"; | ||
| 4 | 4 | export const DatumSchema = z.object({ |
| 5 | 5 | "anomaly": z.string(), |
| 6 | 6 | "value": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Datum = z.infer<typeof DatumSchema>; |
| 9 | 9 | |
| 10 | 10 | export const DescriptionSchema = z.object({ |
| 11 | 11 | "base_period": z.string(), |
| 12 | 12 | "missing": z.number().int(), |
| 13 | 13 | "title": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Description = z.infer<typeof DescriptionSchema>; |
| 16 | 16 | |
| 17 | 17 | export const TopLevelSchema = z.object({ |
| 18 | 18 | "data": z.record(z.string(), DatumSchema), |
| 19 | 19 | "description": DescriptionSchema, |
| 20 | -}); | |
| 20 | +}).strict(); | |
| 21 | 21 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/misc/c0a3a.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -11,14 +11,14 @@ export const StatusSchema = z.object({ | ||
| 11 | 11 | "reason": z.string(), |
| 12 | 12 | "trend": z.string(), |
| 13 | 13 | "type": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Status = z.infer<typeof StatusSchema>; |
| 16 | 16 | |
| 17 | 17 | export const MetaSchema = z.object({ |
| 18 | 18 | "credit": z.string(), |
| 19 | 19 | "updated": z.string(), |
| 20 | 20 | "url": z.string(), |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type Meta = z.infer<typeof MetaSchema>; |
| 23 | 23 | |
| 24 | 24 | export const WeatherSchema = z.object({ |
| @@ -27,7 +27,7 @@ export const WeatherSchema = z.object({ | ||
| 27 | 27 | "visibility": z.number(), |
| 28 | 28 | "weather": z.string(), |
| 29 | 29 | "wind": z.string(), |
| 30 | -}); | |
| 30 | +}).strict(); | |
| 31 | 31 | export type Weather = z.infer<typeof WeatherSchema>; |
| 32 | 32 | |
| 33 | 33 | export const TopLevelSchema = z.object({ |
| @@ -39,5 +39,5 @@ export const TopLevelSchema = z.object({ | ||
| 39 | 39 | "state": z.string(), |
| 40 | 40 | "status": StatusSchema, |
| 41 | 41 | "weather": WeatherSchema, |
| 42 | -}); | |
| 42 | +}).strict(); | |
| 43 | 43 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +10 −10test/inputs/json/misc/c3303.json
Mtypescript-zoddefault / TopLevel.ts+10 −10
| @@ -26,7 +26,7 @@ export const The480_WStillSchema = z.object({ | ||
| 26 | 26 | "size": z.string().regex(/^-?\d+$/).optional(), |
| 27 | 27 | "url": z.string(), |
| 28 | 28 | "width": z.string().regex(/^-?\d+$/), |
| 29 | -}); | |
| 29 | +}).strict(); | |
| 30 | 30 | export type The480_WStill = z.infer<typeof The480_WStillSchema>; |
| 31 | 31 | |
| 32 | 32 | export const DownsizedSmallSchema = z.object({ |
| @@ -34,7 +34,7 @@ export const DownsizedSmallSchema = z.object({ | ||
| 34 | 34 | "mp4": z.string(), |
| 35 | 35 | "mp4_size": z.string().regex(/^-?\d+$/), |
| 36 | 36 | "width": z.string().regex(/^-?\d+$/), |
| 37 | -}); | |
| 37 | +}).strict(); | |
| 38 | 38 | export type DownsizedSmall = z.infer<typeof DownsizedSmallSchema>; |
| 39 | 39 | |
| 40 | 40 | export const FixedHeightSchema = z.object({ |
| @@ -48,13 +48,13 @@ export const FixedHeightSchema = z.object({ | ||
| 48 | 48 | "webp": z.string(), |
| 49 | 49 | "webp_size": z.string().regex(/^-?\d+$/), |
| 50 | 50 | "width": z.string().regex(/^-?\d+$/), |
| 51 | -}); | |
| 51 | +}).strict(); | |
| 52 | 52 | export type FixedHeight = z.infer<typeof FixedHeightSchema>; |
| 53 | 53 | |
| 54 | 54 | export const LoopingSchema = z.object({ |
| 55 | 55 | "mp4": z.string(), |
| 56 | 56 | "mp4_size": z.string().regex(/^-?\d+$/), |
| 57 | -}); | |
| 57 | +}).strict(); | |
| 58 | 58 | export type Looping = z.infer<typeof LoopingSchema>; |
| 59 | 59 | |
| 60 | 60 | export const UserSchema = z.object({ |
| @@ -63,21 +63,21 @@ export const UserSchema = z.object({ | ||
| 63 | 63 | "display_name": z.string(), |
| 64 | 64 | "profile_url": z.string(), |
| 65 | 65 | "username": UsernameSchema, |
| 66 | -}); | |
| 66 | +}).strict(); | |
| 67 | 67 | export type User = z.infer<typeof UserSchema>; |
| 68 | 68 | |
| 69 | 69 | export const MetaSchema = z.object({ |
| 70 | 70 | "msg": z.string(), |
| 71 | 71 | "response_id": z.string(), |
| 72 | 72 | "status": z.number().int(), |
| 73 | -}); | |
| 73 | +}).strict(); | |
| 74 | 74 | export type Meta = z.infer<typeof MetaSchema>; |
| 75 | 75 | |
| 76 | 76 | export const PaginationSchema = z.object({ |
| 77 | 77 | "count": z.number().int(), |
| 78 | 78 | "offset": z.number().int(), |
| 79 | 79 | "total_count": z.number().int(), |
| 80 | -}); | |
| 80 | +}).strict(); | |
| 81 | 81 | export type Pagination = z.infer<typeof PaginationSchema>; |
| 82 | 82 | |
| 83 | 83 | export const ImagesSchema = z.object({ |
| @@ -104,7 +104,7 @@ export const ImagesSchema = z.object({ | ||
| 104 | 104 | "preview_gif": The480_WStillSchema, |
| 105 | 105 | "preview_webp": The480_WStillSchema, |
| 106 | 106 | "480w_still": The480_WStillSchema.optional(), |
| 107 | -}); | |
| 107 | +}).strict(); | |
| 108 | 108 | export type Images = z.infer<typeof ImagesSchema>; |
| 109 | 109 | |
| 110 | 110 | export const DatumSchema = z.object({ |
| @@ -126,12 +126,12 @@ export const DatumSchema = z.object({ | ||
| 126 | 126 | "url": z.string(), |
| 127 | 127 | "user": UserSchema.optional(), |
| 128 | 128 | "username": UsernameSchema, |
| 129 | -}); | |
| 129 | +}).strict(); | |
| 130 | 130 | export type Datum = z.infer<typeof DatumSchema>; |
| 131 | 131 | |
| 132 | 132 | export const TopLevelSchema = z.object({ |
| 133 | 133 | "data": z.array(DatumSchema), |
| 134 | 134 | "meta": MetaSchema, |
| 135 | 135 | "pagination": PaginationSchema, |
| 136 | -}); | |
| 136 | +}).strict(); | |
| 137 | 137 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/json/misc/c6cfd.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -4,10 +4,10 @@ import * as z from "zod"; | ||
| 4 | 4 | export const CountrySchema = z.object({ |
| 5 | 5 | "code": z.string(), |
| 6 | 6 | "name": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Country = z.infer<typeof CountrySchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "countries": z.array(CountrySchema), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +3 −3test/inputs/json/misc/c8c7e.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -17,7 +17,7 @@ export type Value = z.infer<typeof ValueSchema>; | ||
| 17 | 17 | export const CountrySchema = z.object({ |
| 18 | 18 | "id": IdSchema, |
| 19 | 19 | "value": ValueSchema, |
| 20 | -}); | |
| 20 | +}).strict(); | |
| 21 | 21 | export type Country = z.infer<typeof CountrySchema>; |
| 22 | 22 | |
| 23 | 23 | export const FluffyTopLevelSchema = z.object({ |
| @@ -25,7 +25,7 @@ export const FluffyTopLevelSchema = z.object({ | ||
| 25 | 25 | "pages": z.number().int(), |
| 26 | 26 | "per_page": z.string().regex(/^-?\d+$/), |
| 27 | 27 | "total": z.number().int(), |
| 28 | -}); | |
| 28 | +}).strict(); | |
| 29 | 29 | export type FluffyTopLevel = z.infer<typeof FluffyTopLevelSchema>; |
| 30 | 30 | |
| 31 | 31 | export const PurpleTopLevelSchema = z.object({ |
| @@ -34,7 +34,7 @@ export const PurpleTopLevelSchema = z.object({ | ||
| 34 | 34 | "decimal": z.string().regex(/^-?\d+$/), |
| 35 | 35 | "indicator": CountrySchema, |
| 36 | 36 | "value": z.string(), |
| 37 | -}); | |
| 37 | +}).strict(); | |
| 38 | 38 | export type PurpleTopLevel = z.infer<typeof PurpleTopLevelSchema>; |
| 39 | 39 | |
| 40 | 40 | export const TopLevelSchema = z.array(z.union([z.array(PurpleTopLevelSchema), FluffyTopLevelSchema])); |
Test case
1 generated file · +3 −3test/inputs/json/misc/cb0cc.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -17,7 +17,7 @@ export const LaureateSchema = z.object({ | ||
| 17 | 17 | "motivation": z.string().optional(), |
| 18 | 18 | "share": z.string().regex(/^-?\d+$/), |
| 19 | 19 | "surname": z.string(), |
| 20 | -}); | |
| 20 | +}).strict(); | |
| 21 | 21 | export type Laureate = z.infer<typeof LaureateSchema>; |
| 22 | 22 | |
| 23 | 23 | export const PrizeSchema = z.object({ |
| @@ -25,10 +25,10 @@ export const PrizeSchema = z.object({ | ||
| 25 | 25 | "laureates": z.array(LaureateSchema), |
| 26 | 26 | "overallMotivation": z.string().optional(), |
| 27 | 27 | "year": z.string().regex(/^-?\d+$/), |
| 28 | -}); | |
| 28 | +}).strict(); | |
| 29 | 29 | export type Prize = z.infer<typeof PrizeSchema>; |
| 30 | 30 | |
| 31 | 31 | export const TopLevelSchema = z.object({ |
| 32 | 32 | "prizes": z.array(PrizeSchema), |
| 33 | -}); | |
| 33 | +}).strict(); | |
| 34 | 34 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/json/misc/cb81e.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -6,11 +6,11 @@ export const DescriptionSchema = z.object({ | ||
| 6 | 6 | "missing": z.string(), |
| 7 | 7 | "title": z.string(), |
| 8 | 8 | "units": z.string(), |
| 9 | -}); | |
| 9 | +}).strict(); | |
| 10 | 10 | export type Description = z.infer<typeof DescriptionSchema>; |
| 11 | 11 | |
| 12 | 12 | export const TopLevelSchema = z.object({ |
| 13 | 13 | "data": z.record(z.string(), z.string()), |
| 14 | 14 | "description": DescriptionSchema, |
| 15 | -}); | |
| 15 | +}).strict(); | |
| 16 | 16 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/misc/ccd18.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -11,14 +11,14 @@ export const StatusSchema = z.object({ | ||
| 11 | 11 | "reason": z.string(), |
| 12 | 12 | "trend": z.string(), |
| 13 | 13 | "type": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Status = z.infer<typeof StatusSchema>; |
| 16 | 16 | |
| 17 | 17 | export const MetaSchema = z.object({ |
| 18 | 18 | "credit": z.string(), |
| 19 | 19 | "updated": z.string(), |
| 20 | 20 | "url": z.string(), |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type Meta = z.infer<typeof MetaSchema>; |
| 23 | 23 | |
| 24 | 24 | export const WeatherSchema = z.object({ |
| @@ -27,7 +27,7 @@ export const WeatherSchema = z.object({ | ||
| 27 | 27 | "visibility": z.number(), |
| 28 | 28 | "weather": z.string(), |
| 29 | 29 | "wind": z.string(), |
| 30 | -}); | |
| 30 | +}).strict(); | |
| 31 | 31 | export type Weather = z.infer<typeof WeatherSchema>; |
| 32 | 32 | |
| 33 | 33 | export const TopLevelSchema = z.object({ |
| @@ -39,5 +39,5 @@ export const TopLevelSchema = z.object({ | ||
| 39 | 39 | "state": z.string(), |
| 40 | 40 | "status": StatusSchema, |
| 41 | 41 | "weather": WeatherSchema, |
| 42 | -}); | |
| 42 | +}).strict(); | |
| 43 | 43 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/misc/cd238.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -11,14 +11,14 @@ export const StatusSchema = z.object({ | ||
| 11 | 11 | "reason": z.string(), |
| 12 | 12 | "trend": z.string(), |
| 13 | 13 | "type": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Status = z.infer<typeof StatusSchema>; |
| 16 | 16 | |
| 17 | 17 | export const MetaSchema = z.object({ |
| 18 | 18 | "credit": z.string(), |
| 19 | 19 | "updated": z.string(), |
| 20 | 20 | "url": z.string(), |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type Meta = z.infer<typeof MetaSchema>; |
| 23 | 23 | |
| 24 | 24 | export const WeatherSchema = z.object({ |
| @@ -27,7 +27,7 @@ export const WeatherSchema = z.object({ | ||
| 27 | 27 | "visibility": z.number(), |
| 28 | 28 | "weather": z.string(), |
| 29 | 29 | "wind": z.string(), |
| 30 | -}); | |
| 30 | +}).strict(); | |
| 31 | 31 | export type Weather = z.infer<typeof WeatherSchema>; |
| 32 | 32 | |
| 33 | 33 | export const TopLevelSchema = z.object({ |
| @@ -39,5 +39,5 @@ export const TopLevelSchema = z.object({ | ||
| 39 | 39 | "state": z.string(), |
| 40 | 40 | "status": StatusSchema, |
| 41 | 41 | "weather": WeatherSchema, |
| 42 | -}); | |
| 42 | +}).strict(); | |
| 43 | 43 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/cd463.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -5,5 +5,5 @@ export const TopLevelSchema = z.object({ | ||
| 5 | 5 | "base": z.string(), |
| 6 | 6 | "date": z.string(), |
| 7 | 7 | "rates": z.record(z.string(), z.number()), |
| 8 | -}); | |
| 8 | +}).strict(); | |
| 9 | 9 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +3 −3test/inputs/json/misc/cda6c.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -17,7 +17,7 @@ export type Value = z.infer<typeof ValueSchema>; | ||
| 17 | 17 | export const CountrySchema = z.object({ |
| 18 | 18 | "id": IdSchema, |
| 19 | 19 | "value": ValueSchema, |
| 20 | -}); | |
| 20 | +}).strict(); | |
| 21 | 21 | export type Country = z.infer<typeof CountrySchema>; |
| 22 | 22 | |
| 23 | 23 | export const FluffyTopLevelSchema = z.object({ |
| @@ -25,7 +25,7 @@ export const FluffyTopLevelSchema = z.object({ | ||
| 25 | 25 | "pages": z.number().int(), |
| 26 | 26 | "per_page": z.string().regex(/^-?\d+$/), |
| 27 | 27 | "total": z.number().int(), |
| 28 | -}); | |
| 28 | +}).strict(); | |
| 29 | 29 | export type FluffyTopLevel = z.infer<typeof FluffyTopLevelSchema>; |
| 30 | 30 | |
| 31 | 31 | export const PurpleTopLevelSchema = z.object({ |
| @@ -34,7 +34,7 @@ export const PurpleTopLevelSchema = z.object({ | ||
| 34 | 34 | "decimal": z.string().regex(/^-?\d+$/), |
| 35 | 35 | "indicator": CountrySchema, |
| 36 | 36 | "value": z.string().regex(/^-?\d+$/), |
| 37 | -}); | |
| 37 | +}).strict(); | |
| 38 | 38 | export type PurpleTopLevel = z.infer<typeof PurpleTopLevelSchema>; |
| 39 | 39 | |
| 40 | 40 | export const TopLevelSchema = z.array(z.union([z.array(PurpleTopLevelSchema), FluffyTopLevelSchema])); |
Test case
1 generated file · +14 −14test/inputs/json/misc/cf0d8.json
Mtypescript-zoddefault / TopLevel.ts+14 −14
| @@ -4,7 +4,7 @@ import * as z from "zod"; | ||
| 4 | 4 | export const AstronomySchema = z.object({ |
| 5 | 5 | "sunrise": z.string(), |
| 6 | 6 | "sunset": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Astronomy = z.infer<typeof AstronomySchema>; |
| 9 | 9 | |
| 10 | 10 | export const AtmosphereSchema = z.object({ |
| @@ -12,7 +12,7 @@ export const AtmosphereSchema = z.object({ | ||
| 12 | 12 | "pressure": z.string(), |
| 13 | 13 | "rising": z.string().regex(/^-?\d+$/), |
| 14 | 14 | "visibility": z.string(), |
| 15 | -}); | |
| 15 | +}).strict(); | |
| 16 | 16 | export type Atmosphere = z.infer<typeof AtmosphereSchema>; |
| 17 | 17 | |
| 18 | 18 | export const ImageSchema = z.object({ |
| @@ -21,7 +21,7 @@ export const ImageSchema = z.object({ | ||
| 21 | 21 | "title": z.string(), |
| 22 | 22 | "url": z.string(), |
| 23 | 23 | "width": z.string().regex(/^-?\d+$/), |
| 24 | -}); | |
| 24 | +}).strict(); | |
| 25 | 25 | export type Image = z.infer<typeof ImageSchema>; |
| 26 | 26 | |
| 27 | 27 | export const ConditionSchema = z.object({ |
| @@ -29,7 +29,7 @@ export const ConditionSchema = z.object({ | ||
| 29 | 29 | "date": z.string(), |
| 30 | 30 | "temp": z.string().regex(/^-?\d+$/), |
| 31 | 31 | "text": z.string(), |
| 32 | -}); | |
| 32 | +}).strict(); | |
| 33 | 33 | export type Condition = z.infer<typeof ConditionSchema>; |
| 34 | 34 | |
| 35 | 35 | export const ForecastSchema = z.object({ |
| @@ -39,19 +39,19 @@ export const ForecastSchema = z.object({ | ||
| 39 | 39 | "high": z.string().regex(/^-?\d+$/), |
| 40 | 40 | "low": z.string().regex(/^-?\d+$/), |
| 41 | 41 | "text": z.string(), |
| 42 | -}); | |
| 42 | +}).strict(); | |
| 43 | 43 | export type Forecast = z.infer<typeof ForecastSchema>; |
| 44 | 44 | |
| 45 | 45 | export const GuidSchema = z.object({ |
| 46 | 46 | "isPermaLink": z.enum(["true", "false"]), |
| 47 | -}); | |
| 47 | +}).strict(); | |
| 48 | 48 | export type Guid = z.infer<typeof GuidSchema>; |
| 49 | 49 | |
| 50 | 50 | export const LocationSchema = z.object({ |
| 51 | 51 | "city": z.string(), |
| 52 | 52 | "country": z.string(), |
| 53 | 53 | "region": z.string(), |
| 54 | -}); | |
| 54 | +}).strict(); | |
| 55 | 55 | export type Location = z.infer<typeof LocationSchema>; |
| 56 | 56 | |
| 57 | 57 | export const UnitsSchema = z.object({ |
| @@ -59,14 +59,14 @@ export const UnitsSchema = z.object({ | ||
| 59 | 59 | "pressure": z.string(), |
| 60 | 60 | "speed": z.string(), |
| 61 | 61 | "temperature": z.string(), |
| 62 | -}); | |
| 62 | +}).strict(); | |
| 63 | 63 | export type Units = z.infer<typeof UnitsSchema>; |
| 64 | 64 | |
| 65 | 65 | export const WindSchema = z.object({ |
| 66 | 66 | "chill": z.string().regex(/^-?\d+$/), |
| 67 | 67 | "direction": z.string().regex(/^-?\d+$/), |
| 68 | 68 | "speed": z.string().regex(/^-?\d+$/), |
| 69 | -}); | |
| 69 | +}).strict(); | |
| 70 | 70 | export type Wind = z.infer<typeof WindSchema>; |
| 71 | 71 | |
| 72 | 72 | export const ItemSchema = z.object({ |
| @@ -79,7 +79,7 @@ export const ItemSchema = z.object({ | ||
| 79 | 79 | "long": z.string(), |
| 80 | 80 | "pubDate": z.string(), |
| 81 | 81 | "title": z.string(), |
| 82 | -}); | |
| 82 | +}).strict(); | |
| 83 | 83 | export type Item = z.infer<typeof ItemSchema>; |
| 84 | 84 | |
| 85 | 85 | export const ChannelSchema = z.object({ |
| @@ -96,12 +96,12 @@ export const ChannelSchema = z.object({ | ||
| 96 | 96 | "ttl": z.string().regex(/^-?\d+$/), |
| 97 | 97 | "units": UnitsSchema, |
| 98 | 98 | "wind": WindSchema, |
| 99 | -}); | |
| 99 | +}).strict(); | |
| 100 | 100 | export type Channel = z.infer<typeof ChannelSchema>; |
| 101 | 101 | |
| 102 | 102 | export const ResultsSchema = z.object({ |
| 103 | 103 | "channel": ChannelSchema, |
| 104 | -}); | |
| 104 | +}).strict(); | |
| 105 | 105 | export type Results = z.infer<typeof ResultsSchema>; |
| 106 | 106 | |
| 107 | 107 | export const QuerySchema = z.object({ |
| @@ -109,10 +109,10 @@ export const QuerySchema = z.object({ | ||
| 109 | 109 | "created": z.coerce.date(), |
| 110 | 110 | "lang": z.string(), |
| 111 | 111 | "results": ResultsSchema, |
| 112 | -}); | |
| 112 | +}).strict(); | |
| 113 | 113 | export type Query = z.infer<typeof QuerySchema>; |
| 114 | 114 | |
| 115 | 115 | export const TopLevelSchema = z.object({ |
| 116 | 116 | "query": QuerySchema, |
| 117 | -}); | |
| 117 | +}).strict(); | |
| 118 | 118 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/cfbce.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -5,5 +5,5 @@ export const TopLevelSchema = z.object({ | ||
| 5 | 5 | "base": z.string(), |
| 6 | 6 | "date": z.string(), |
| 7 | 7 | "rates": z.record(z.string(), z.number()), |
| 8 | -}); | |
| 8 | +}).strict(); | |
| 9 | 9 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/json/misc/d0908.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -4,10 +4,10 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TotalPopulationSchema = z.object({ |
| 5 | 5 | "date": z.string(), |
| 6 | 6 | "population": z.number().int(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type TotalPopulation = z.infer<typeof TotalPopulationSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "total_population": z.array(TotalPopulationSchema), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +3 −3test/inputs/json/misc/d23d5.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -2,7 +2,7 @@ import * as z from "zod"; | ||
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | export const FacetsSchema = z.object({ |
| 5 | -}); | |
| 5 | +}).strict(); | |
| 6 | 6 | export type Facets = z.infer<typeof FacetsSchema>; |
| 7 | 7 | |
| 8 | 8 | export const ResultSchema = z.object({ |
| @@ -12,7 +12,7 @@ export const ResultSchema = z.object({ | ||
| 12 | 12 | "name": z.string(), |
| 13 | 13 | "updated_at": z.coerce.date(), |
| 14 | 14 | "uri": z.string(), |
| 15 | -}); | |
| 15 | +}).strict(); | |
| 16 | 16 | export type Result = z.infer<typeof ResultSchema>; |
| 17 | 17 | |
| 18 | 18 | export const TopLevelSchema = z.object({ |
| @@ -23,5 +23,5 @@ export const TopLevelSchema = z.object({ | ||
| 23 | 23 | "offset": z.number().int(), |
| 24 | 24 | "previous": z.boolean(), |
| 25 | 25 | "results": z.array(ResultSchema), |
| 26 | -}); | |
| 26 | +}).strict(); | |
| 27 | 27 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +14 −14test/inputs/json/misc/dbfb3.json
Mtypescript-zoddefault / TopLevel.ts+14 −14
| @@ -10,7 +10,7 @@ export type Text = z.infer<typeof TextSchema>; | ||
| 10 | 10 | export const AstronomySchema = z.object({ |
| 11 | 11 | "sunrise": z.string(), |
| 12 | 12 | "sunset": z.string(), |
| 13 | -}); | |
| 13 | +}).strict(); | |
| 14 | 14 | export type Astronomy = z.infer<typeof AstronomySchema>; |
| 15 | 15 | |
| 16 | 16 | export const AtmosphereSchema = z.object({ |
| @@ -18,7 +18,7 @@ export const AtmosphereSchema = z.object({ | ||
| 18 | 18 | "pressure": z.string(), |
| 19 | 19 | "rising": z.string().regex(/^-?\d+$/), |
| 20 | 20 | "visibility": z.string(), |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type Atmosphere = z.infer<typeof AtmosphereSchema>; |
| 23 | 23 | |
| 24 | 24 | export const ImageSchema = z.object({ |
| @@ -27,7 +27,7 @@ export const ImageSchema = z.object({ | ||
| 27 | 27 | "title": z.string(), |
| 28 | 28 | "url": z.string(), |
| 29 | 29 | "width": z.string().regex(/^-?\d+$/), |
| 30 | -}); | |
| 30 | +}).strict(); | |
| 31 | 31 | export type Image = z.infer<typeof ImageSchema>; |
| 32 | 32 | |
| 33 | 33 | export const ConditionSchema = z.object({ |
| @@ -35,7 +35,7 @@ export const ConditionSchema = z.object({ | ||
| 35 | 35 | "date": z.string(), |
| 36 | 36 | "temp": z.string().regex(/^-?\d+$/), |
| 37 | 37 | "text": TextSchema, |
| 38 | -}); | |
| 38 | +}).strict(); | |
| 39 | 39 | export type Condition = z.infer<typeof ConditionSchema>; |
| 40 | 40 | |
| 41 | 41 | export const ForecastSchema = z.object({ |
| @@ -45,19 +45,19 @@ export const ForecastSchema = z.object({ | ||
| 45 | 45 | "high": z.string().regex(/^-?\d+$/), |
| 46 | 46 | "low": z.string().regex(/^-?\d+$/), |
| 47 | 47 | "text": TextSchema, |
| 48 | -}); | |
| 48 | +}).strict(); | |
| 49 | 49 | export type Forecast = z.infer<typeof ForecastSchema>; |
| 50 | 50 | |
| 51 | 51 | export const GuidSchema = z.object({ |
| 52 | 52 | "isPermaLink": z.enum(["true", "false"]), |
| 53 | -}); | |
| 53 | +}).strict(); | |
| 54 | 54 | export type Guid = z.infer<typeof GuidSchema>; |
| 55 | 55 | |
| 56 | 56 | export const LocationSchema = z.object({ |
| 57 | 57 | "city": z.string(), |
| 58 | 58 | "country": z.string(), |
| 59 | 59 | "region": z.string(), |
| 60 | -}); | |
| 60 | +}).strict(); | |
| 61 | 61 | export type Location = z.infer<typeof LocationSchema>; |
| 62 | 62 | |
| 63 | 63 | export const UnitsSchema = z.object({ |
| @@ -65,14 +65,14 @@ export const UnitsSchema = z.object({ | ||
| 65 | 65 | "pressure": z.string(), |
| 66 | 66 | "speed": z.string(), |
| 67 | 67 | "temperature": z.string(), |
| 68 | -}); | |
| 68 | +}).strict(); | |
| 69 | 69 | export type Units = z.infer<typeof UnitsSchema>; |
| 70 | 70 | |
| 71 | 71 | export const WindSchema = z.object({ |
| 72 | 72 | "chill": z.string().regex(/^-?\d+$/), |
| 73 | 73 | "direction": z.string().regex(/^-?\d+$/), |
| 74 | 74 | "speed": z.string().regex(/^-?\d+$/), |
| 75 | -}); | |
| 75 | +}).strict(); | |
| 76 | 76 | export type Wind = z.infer<typeof WindSchema>; |
| 77 | 77 | |
| 78 | 78 | export const ItemSchema = z.object({ |
| @@ -85,7 +85,7 @@ export const ItemSchema = z.object({ | ||
| 85 | 85 | "long": z.string(), |
| 86 | 86 | "pubDate": z.string(), |
| 87 | 87 | "title": z.string(), |
| 88 | -}); | |
| 88 | +}).strict(); | |
| 89 | 89 | export type Item = z.infer<typeof ItemSchema>; |
| 90 | 90 | |
| 91 | 91 | export const ChannelSchema = z.object({ |
| @@ -102,12 +102,12 @@ export const ChannelSchema = z.object({ | ||
| 102 | 102 | "ttl": z.string().regex(/^-?\d+$/), |
| 103 | 103 | "units": UnitsSchema, |
| 104 | 104 | "wind": WindSchema, |
| 105 | -}); | |
| 105 | +}).strict(); | |
| 106 | 106 | export type Channel = z.infer<typeof ChannelSchema>; |
| 107 | 107 | |
| 108 | 108 | export const ResultsSchema = z.object({ |
| 109 | 109 | "channel": ChannelSchema, |
| 110 | -}); | |
| 110 | +}).strict(); | |
| 111 | 111 | export type Results = z.infer<typeof ResultsSchema>; |
| 112 | 112 | |
| 113 | 113 | export const QuerySchema = z.object({ |
| @@ -115,10 +115,10 @@ export const QuerySchema = z.object({ | ||
| 115 | 115 | "created": z.coerce.date(), |
| 116 | 116 | "lang": z.string(), |
| 117 | 117 | "results": ResultsSchema, |
| 118 | -}); | |
| 118 | +}).strict(); | |
| 119 | 119 | export type Query = z.infer<typeof QuerySchema>; |
| 120 | 120 | |
| 121 | 121 | export const TopLevelSchema = z.object({ |
| 122 | 122 | "query": QuerySchema, |
| 123 | -}); | |
| 123 | +}).strict(); | |
| 124 | 124 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/misc/dc44f.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -106,13 +106,13 @@ export type Type = z.infer<typeof TypeSchema>; | ||
| 106 | 106 | export const LegalityElementSchema = z.object({ |
| 107 | 107 | "format": FormatSchema, |
| 108 | 108 | "legality": LegalityEnumSchema, |
| 109 | -}); | |
| 109 | +}).strict(); | |
| 110 | 110 | export type LegalityElement = z.infer<typeof LegalityElementSchema>; |
| 111 | 111 | |
| 112 | 112 | export const RulingSchema = z.object({ |
| 113 | 113 | "date": z.string(), |
| 114 | 114 | "text": z.string(), |
| 115 | -}); | |
| 115 | +}).strict(); | |
| 116 | 116 | export type Ruling = z.infer<typeof RulingSchema>; |
| 117 | 117 | |
| 118 | 118 | export const CardSchema = z.object({ |
| @@ -143,7 +143,7 @@ export const CardSchema = z.object({ | ||
| 143 | 143 | "type": z.string(), |
| 144 | 144 | "types": z.array(TypeSchema), |
| 145 | 145 | "variations": z.array(z.number().int()).optional(), |
| 146 | -}); | |
| 146 | +}).strict(); | |
| 147 | 147 | export type Card = z.infer<typeof CardSchema>; |
| 148 | 148 | |
| 149 | 149 | export const TopLevelSchema = z.object({ |
| @@ -158,5 +158,5 @@ export const TopLevelSchema = z.object({ | ||
| 158 | 158 | "name": z.string(), |
| 159 | 159 | "releaseDate": z.string(), |
| 160 | 160 | "type": z.string(), |
| 161 | -}); | |
| 161 | +}).strict(); | |
| 162 | 162 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/misc/dd1ce.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -106,13 +106,13 @@ export type Type = z.infer<typeof TypeSchema>; | ||
| 106 | 106 | export const LegalityElementSchema = z.object({ |
| 107 | 107 | "format": FormatSchema, |
| 108 | 108 | "legality": LegalityEnumSchema, |
| 109 | -}); | |
| 109 | +}).strict(); | |
| 110 | 110 | export type LegalityElement = z.infer<typeof LegalityElementSchema>; |
| 111 | 111 | |
| 112 | 112 | export const RulingSchema = z.object({ |
| 113 | 113 | "date": z.string(), |
| 114 | 114 | "text": z.string(), |
| 115 | -}); | |
| 115 | +}).strict(); | |
| 116 | 116 | export type Ruling = z.infer<typeof RulingSchema>; |
| 117 | 117 | |
| 118 | 118 | export const CardSchema = z.object({ |
| @@ -143,7 +143,7 @@ export const CardSchema = z.object({ | ||
| 143 | 143 | "type": z.string(), |
| 144 | 144 | "types": z.array(TypeSchema), |
| 145 | 145 | "variations": z.array(z.number().int()).optional(), |
| 146 | -}); | |
| 146 | +}).strict(); | |
| 147 | 147 | export type Card = z.infer<typeof CardSchema>; |
| 148 | 148 | |
| 149 | 149 | export const TopLevelSchema = z.object({ |
| @@ -158,5 +158,5 @@ export const TopLevelSchema = z.object({ | ||
| 158 | 158 | "name": z.string(), |
| 159 | 159 | "releaseDate": z.string(), |
| 160 | 160 | "type": z.string(), |
| 161 | -}); | |
| 161 | +}).strict(); | |
| 162 | 162 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +7 −7test/inputs/json/misc/dec3a.json
Mtypescript-zoddefault / TopLevel.ts+7 −7
| @@ -4,20 +4,20 @@ import * as z from "zod"; | ||
| 4 | 4 | export const ResponseInfoSchema = z.object({ |
| 5 | 5 | "developerMessage": z.string(), |
| 6 | 6 | "status": z.number().int(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type ResponseInfo = z.infer<typeof ResponseInfoSchema>; |
| 9 | 9 | |
| 10 | 10 | export const ResultsetSchema = z.object({ |
| 11 | 11 | "count": z.number().int(), |
| 12 | 12 | "page": z.number().int(), |
| 13 | 13 | "pagesize": z.number().int(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Resultset = z.infer<typeof ResultsetSchema>; |
| 16 | 16 | |
| 17 | 17 | export const HiringOrgSchema = z.object({ |
| 18 | 18 | "name": z.string(), |
| 19 | 19 | "uuid": z.string().uuid(), |
| 20 | -}); | |
| 20 | +}).strict(); | |
| 21 | 21 | export type HiringOrg = z.infer<typeof HiringOrgSchema>; |
| 22 | 22 | |
| 23 | 23 | export const LocationSchema = z.object({ |
| @@ -31,14 +31,14 @@ export const LocationSchema = z.object({ | ||
| 31 | 31 | "postal_code": z.string().regex(/^-?\d+$/), |
| 32 | 32 | "sub_premise": z.null(), |
| 33 | 33 | "thoroughfare": z.string(), |
| 34 | -}); | |
| 34 | +}).strict(); | |
| 35 | 35 | export type Location = z.infer<typeof LocationSchema>; |
| 36 | 36 | |
| 37 | 37 | export const MetadataSchema = z.object({ |
| 38 | 38 | "executionTime": z.number(), |
| 39 | 39 | "responseInfo": ResponseInfoSchema, |
| 40 | 40 | "resultset": ResultsetSchema, |
| 41 | -}); | |
| 41 | +}).strict(); | |
| 42 | 42 | export type Metadata = z.infer<typeof MetadataSchema>; |
| 43 | 43 | |
| 44 | 44 | export const ResultSchema = z.object({ |
| @@ -64,11 +64,11 @@ export const ResultSchema = z.object({ | ||
| 64 | 64 | "url": z.string(), |
| 65 | 65 | "uuid": z.string().uuid(), |
| 66 | 66 | "vuuid": z.string().uuid(), |
| 67 | -}); | |
| 67 | +}).strict(); | |
| 68 | 68 | export type Result = z.infer<typeof ResultSchema>; |
| 69 | 69 | |
| 70 | 70 | export const TopLevelSchema = z.object({ |
| 71 | 71 | "metadata": MetadataSchema, |
| 72 | 72 | "results": z.array(ResultSchema), |
| 73 | -}); | |
| 73 | +}).strict(); | |
| 74 | 74 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +14 −14test/inputs/json/misc/df957.json
Mtypescript-zoddefault / TopLevel.ts+14 −14
| @@ -4,7 +4,7 @@ import * as z from "zod"; | ||
| 4 | 4 | export const AstronomySchema = z.object({ |
| 5 | 5 | "sunrise": z.string(), |
| 6 | 6 | "sunset": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Astronomy = z.infer<typeof AstronomySchema>; |
| 9 | 9 | |
| 10 | 10 | export const AtmosphereSchema = z.object({ |
| @@ -12,7 +12,7 @@ export const AtmosphereSchema = z.object({ | ||
| 12 | 12 | "pressure": z.string(), |
| 13 | 13 | "rising": z.string().regex(/^-?\d+$/), |
| 14 | 14 | "visibility": z.string(), |
| 15 | -}); | |
| 15 | +}).strict(); | |
| 16 | 16 | export type Atmosphere = z.infer<typeof AtmosphereSchema>; |
| 17 | 17 | |
| 18 | 18 | export const ImageSchema = z.object({ |
| @@ -21,7 +21,7 @@ export const ImageSchema = z.object({ | ||
| 21 | 21 | "title": z.string(), |
| 22 | 22 | "url": z.string(), |
| 23 | 23 | "width": z.string().regex(/^-?\d+$/), |
| 24 | -}); | |
| 24 | +}).strict(); | |
| 25 | 25 | export type Image = z.infer<typeof ImageSchema>; |
| 26 | 26 | |
| 27 | 27 | export const ConditionSchema = z.object({ |
| @@ -29,7 +29,7 @@ export const ConditionSchema = z.object({ | ||
| 29 | 29 | "date": z.string(), |
| 30 | 30 | "temp": z.string().regex(/^-?\d+$/), |
| 31 | 31 | "text": z.string(), |
| 32 | -}); | |
| 32 | +}).strict(); | |
| 33 | 33 | export type Condition = z.infer<typeof ConditionSchema>; |
| 34 | 34 | |
| 35 | 35 | export const ForecastSchema = z.object({ |
| @@ -39,19 +39,19 @@ export const ForecastSchema = z.object({ | ||
| 39 | 39 | "high": z.string().regex(/^-?\d+$/), |
| 40 | 40 | "low": z.string().regex(/^-?\d+$/), |
| 41 | 41 | "text": z.string(), |
| 42 | -}); | |
| 42 | +}).strict(); | |
| 43 | 43 | export type Forecast = z.infer<typeof ForecastSchema>; |
| 44 | 44 | |
| 45 | 45 | export const GuidSchema = z.object({ |
| 46 | 46 | "isPermaLink": z.enum(["true", "false"]), |
| 47 | -}); | |
| 47 | +}).strict(); | |
| 48 | 48 | export type Guid = z.infer<typeof GuidSchema>; |
| 49 | 49 | |
| 50 | 50 | export const LocationSchema = z.object({ |
| 51 | 51 | "city": z.string(), |
| 52 | 52 | "country": z.string(), |
| 53 | 53 | "region": z.string(), |
| 54 | -}); | |
| 54 | +}).strict(); | |
| 55 | 55 | export type Location = z.infer<typeof LocationSchema>; |
| 56 | 56 | |
| 57 | 57 | export const UnitsSchema = z.object({ |
| @@ -59,14 +59,14 @@ export const UnitsSchema = z.object({ | ||
| 59 | 59 | "pressure": z.string(), |
| 60 | 60 | "speed": z.string(), |
| 61 | 61 | "temperature": z.string(), |
| 62 | -}); | |
| 62 | +}).strict(); | |
| 63 | 63 | export type Units = z.infer<typeof UnitsSchema>; |
| 64 | 64 | |
| 65 | 65 | export const WindSchema = z.object({ |
| 66 | 66 | "chill": z.string().regex(/^-?\d+$/), |
| 67 | 67 | "direction": z.string().regex(/^-?\d+$/), |
| 68 | 68 | "speed": z.string().regex(/^-?\d+$/), |
| 69 | -}); | |
| 69 | +}).strict(); | |
| 70 | 70 | export type Wind = z.infer<typeof WindSchema>; |
| 71 | 71 | |
| 72 | 72 | export const ItemSchema = z.object({ |
| @@ -79,7 +79,7 @@ export const ItemSchema = z.object({ | ||
| 79 | 79 | "long": z.string(), |
| 80 | 80 | "pubDate": z.string(), |
| 81 | 81 | "title": z.string(), |
| 82 | -}); | |
| 82 | +}).strict(); | |
| 83 | 83 | export type Item = z.infer<typeof ItemSchema>; |
| 84 | 84 | |
| 85 | 85 | export const ChannelSchema = z.object({ |
| @@ -96,12 +96,12 @@ export const ChannelSchema = z.object({ | ||
| 96 | 96 | "ttl": z.string().regex(/^-?\d+$/), |
| 97 | 97 | "units": UnitsSchema, |
| 98 | 98 | "wind": WindSchema, |
| 99 | -}); | |
| 99 | +}).strict(); | |
| 100 | 100 | export type Channel = z.infer<typeof ChannelSchema>; |
| 101 | 101 | |
| 102 | 102 | export const ResultsSchema = z.object({ |
| 103 | 103 | "channel": ChannelSchema, |
| 104 | -}); | |
| 104 | +}).strict(); | |
| 105 | 105 | export type Results = z.infer<typeof ResultsSchema>; |
| 106 | 106 | |
| 107 | 107 | export const QuerySchema = z.object({ |
| @@ -109,10 +109,10 @@ export const QuerySchema = z.object({ | ||
| 109 | 109 | "created": z.coerce.date(), |
| 110 | 110 | "lang": z.string(), |
| 111 | 111 | "results": ResultsSchema, |
| 112 | -}); | |
| 112 | +}).strict(); | |
| 113 | 113 | export type Query = z.infer<typeof QuerySchema>; |
| 114 | 114 | |
| 115 | 115 | export const TopLevelSchema = z.object({ |
| 116 | 116 | "query": QuerySchema, |
| 117 | -}); | |
| 117 | +}).strict(); | |
| 118 | 118 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +10 −10test/inputs/json/misc/e0ac7.json
Mtypescript-zoddefault / TopLevel.ts+10 −10
| @@ -19,7 +19,7 @@ export const DownsizedSchema = z.object({ | ||
| 19 | 19 | "size": z.string().regex(/^-?\d+$/).optional(), |
| 20 | 20 | "url": z.string(), |
| 21 | 21 | "width": z.string().regex(/^-?\d+$/), |
| 22 | -}); | |
| 22 | +}).strict(); | |
| 23 | 23 | export type Downsized = z.infer<typeof DownsizedSchema>; |
| 24 | 24 | |
| 25 | 25 | export const DownsizedSmallSchema = z.object({ |
| @@ -27,7 +27,7 @@ export const DownsizedSmallSchema = z.object({ | ||
| 27 | 27 | "mp4": z.string(), |
| 28 | 28 | "mp4_size": z.string().regex(/^-?\d+$/), |
| 29 | 29 | "width": z.string().regex(/^-?\d+$/), |
| 30 | -}); | |
| 30 | +}).strict(); | |
| 31 | 31 | export type DownsizedSmall = z.infer<typeof DownsizedSmallSchema>; |
| 32 | 32 | |
| 33 | 33 | export const FixedHeightSchema = z.object({ |
| @@ -41,13 +41,13 @@ export const FixedHeightSchema = z.object({ | ||
| 41 | 41 | "webp": z.string(), |
| 42 | 42 | "webp_size": z.string().regex(/^-?\d+$/), |
| 43 | 43 | "width": z.string().regex(/^-?\d+$/), |
| 44 | -}); | |
| 44 | +}).strict(); | |
| 45 | 45 | export type FixedHeight = z.infer<typeof FixedHeightSchema>; |
| 46 | 46 | |
| 47 | 47 | export const LoopingSchema = z.object({ |
| 48 | 48 | "mp4": z.string(), |
| 49 | 49 | "mp4_size": z.string().regex(/^-?\d+$/), |
| 50 | -}); | |
| 50 | +}).strict(); | |
| 51 | 51 | export type Looping = z.infer<typeof LoopingSchema>; |
| 52 | 52 | |
| 53 | 53 | export const UserSchema = z.object({ |
| @@ -57,21 +57,21 @@ export const UserSchema = z.object({ | ||
| 57 | 57 | "profile_url": z.string(), |
| 58 | 58 | "twitter": z.string(), |
| 59 | 59 | "username": z.string(), |
| 60 | -}); | |
| 60 | +}).strict(); | |
| 61 | 61 | export type User = z.infer<typeof UserSchema>; |
| 62 | 62 | |
| 63 | 63 | export const MetaSchema = z.object({ |
| 64 | 64 | "msg": z.string(), |
| 65 | 65 | "response_id": z.string(), |
| 66 | 66 | "status": z.number().int(), |
| 67 | -}); | |
| 67 | +}).strict(); | |
| 68 | 68 | export type Meta = z.infer<typeof MetaSchema>; |
| 69 | 69 | |
| 70 | 70 | export const PaginationSchema = z.object({ |
| 71 | 71 | "count": z.number().int(), |
| 72 | 72 | "offset": z.number().int(), |
| 73 | 73 | "total_count": z.number().int(), |
| 74 | -}); | |
| 74 | +}).strict(); | |
| 75 | 75 | export type Pagination = z.infer<typeof PaginationSchema>; |
| 76 | 76 | |
| 77 | 77 | export const ImagesSchema = z.object({ |
| @@ -98,7 +98,7 @@ export const ImagesSchema = z.object({ | ||
| 98 | 98 | "preview": DownsizedSmallSchema, |
| 99 | 99 | "preview_gif": DownsizedSchema, |
| 100 | 100 | "preview_webp": DownsizedSchema, |
| 101 | -}); | |
| 101 | +}).strict(); | |
| 102 | 102 | export type Images = z.infer<typeof ImagesSchema>; |
| 103 | 103 | |
| 104 | 104 | export const DatumSchema = z.object({ |
| @@ -120,12 +120,12 @@ export const DatumSchema = z.object({ | ||
| 120 | 120 | "url": z.string(), |
| 121 | 121 | "user": UserSchema.optional(), |
| 122 | 122 | "username": z.string(), |
| 123 | -}); | |
| 123 | +}).strict(); | |
| 124 | 124 | export type Datum = z.infer<typeof DatumSchema>; |
| 125 | 125 | |
| 126 | 126 | export const TopLevelSchema = z.object({ |
| 127 | 127 | "data": z.array(DatumSchema), |
| 128 | 128 | "meta": MetaSchema, |
| 129 | 129 | "pagination": PaginationSchema, |
| 130 | -}); | |
| 130 | +}).strict(); | |
| 131 | 131 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +14 −14test/inputs/json/misc/e2915.json
Mtypescript-zoddefault / TopLevel.ts+14 −14
| @@ -9,7 +9,7 @@ export type Text = z.infer<typeof TextSchema>; | ||
| 9 | 9 | export const AstronomySchema = z.object({ |
| 10 | 10 | "sunrise": z.string(), |
| 11 | 11 | "sunset": z.string(), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type Astronomy = z.infer<typeof AstronomySchema>; |
| 14 | 14 | |
| 15 | 15 | export const AtmosphereSchema = z.object({ |
| @@ -17,7 +17,7 @@ export const AtmosphereSchema = z.object({ | ||
| 17 | 17 | "pressure": z.string(), |
| 18 | 18 | "rising": z.string().regex(/^-?\d+$/), |
| 19 | 19 | "visibility": z.string(), |
| 20 | -}); | |
| 20 | +}).strict(); | |
| 21 | 21 | export type Atmosphere = z.infer<typeof AtmosphereSchema>; |
| 22 | 22 | |
| 23 | 23 | export const ImageSchema = z.object({ |
| @@ -26,7 +26,7 @@ export const ImageSchema = z.object({ | ||
| 26 | 26 | "title": z.string(), |
| 27 | 27 | "url": z.string(), |
| 28 | 28 | "width": z.string().regex(/^-?\d+$/), |
| 29 | -}); | |
| 29 | +}).strict(); | |
| 30 | 30 | export type Image = z.infer<typeof ImageSchema>; |
| 31 | 31 | |
| 32 | 32 | export const ConditionSchema = z.object({ |
| @@ -34,7 +34,7 @@ export const ConditionSchema = z.object({ | ||
| 34 | 34 | "date": z.string(), |
| 35 | 35 | "temp": z.string().regex(/^-?\d+$/), |
| 36 | 36 | "text": z.string(), |
| 37 | -}); | |
| 37 | +}).strict(); | |
| 38 | 38 | export type Condition = z.infer<typeof ConditionSchema>; |
| 39 | 39 | |
| 40 | 40 | export const ForecastSchema = z.object({ |
| @@ -44,19 +44,19 @@ export const ForecastSchema = z.object({ | ||
| 44 | 44 | "high": z.string().regex(/^-?\d+$/), |
| 45 | 45 | "low": z.string().regex(/^-?\d+$/), |
| 46 | 46 | "text": TextSchema, |
| 47 | -}); | |
| 47 | +}).strict(); | |
| 48 | 48 | export type Forecast = z.infer<typeof ForecastSchema>; |
| 49 | 49 | |
| 50 | 50 | export const GuidSchema = z.object({ |
| 51 | 51 | "isPermaLink": z.enum(["true", "false"]), |
| 52 | -}); | |
| 52 | +}).strict(); | |
| 53 | 53 | export type Guid = z.infer<typeof GuidSchema>; |
| 54 | 54 | |
| 55 | 55 | export const LocationSchema = z.object({ |
| 56 | 56 | "city": z.string(), |
| 57 | 57 | "country": z.string(), |
| 58 | 58 | "region": z.string(), |
| 59 | -}); | |
| 59 | +}).strict(); | |
| 60 | 60 | export type Location = z.infer<typeof LocationSchema>; |
| 61 | 61 | |
| 62 | 62 | export const UnitsSchema = z.object({ |
| @@ -64,14 +64,14 @@ export const UnitsSchema = z.object({ | ||
| 64 | 64 | "pressure": z.string(), |
| 65 | 65 | "speed": z.string(), |
| 66 | 66 | "temperature": z.string(), |
| 67 | -}); | |
| 67 | +}).strict(); | |
| 68 | 68 | export type Units = z.infer<typeof UnitsSchema>; |
| 69 | 69 | |
| 70 | 70 | export const WindSchema = z.object({ |
| 71 | 71 | "chill": z.string().regex(/^-?\d+$/), |
| 72 | 72 | "direction": z.string().regex(/^-?\d+$/), |
| 73 | 73 | "speed": z.string().regex(/^-?\d+$/), |
| 74 | -}); | |
| 74 | +}).strict(); | |
| 75 | 75 | export type Wind = z.infer<typeof WindSchema>; |
| 76 | 76 | |
| 77 | 77 | export const ItemSchema = z.object({ |
| @@ -84,7 +84,7 @@ export const ItemSchema = z.object({ | ||
| 84 | 84 | "long": z.string(), |
| 85 | 85 | "pubDate": z.string(), |
| 86 | 86 | "title": z.string(), |
| 87 | -}); | |
| 87 | +}).strict(); | |
| 88 | 88 | export type Item = z.infer<typeof ItemSchema>; |
| 89 | 89 | |
| 90 | 90 | export const ChannelSchema = z.object({ |
| @@ -101,12 +101,12 @@ export const ChannelSchema = z.object({ | ||
| 101 | 101 | "ttl": z.string().regex(/^-?\d+$/), |
| 102 | 102 | "units": UnitsSchema, |
| 103 | 103 | "wind": WindSchema, |
| 104 | -}); | |
| 104 | +}).strict(); | |
| 105 | 105 | export type Channel = z.infer<typeof ChannelSchema>; |
| 106 | 106 | |
| 107 | 107 | export const ResultsSchema = z.object({ |
| 108 | 108 | "channel": ChannelSchema, |
| 109 | -}); | |
| 109 | +}).strict(); | |
| 110 | 110 | export type Results = z.infer<typeof ResultsSchema>; |
| 111 | 111 | |
| 112 | 112 | export const QuerySchema = z.object({ |
| @@ -114,10 +114,10 @@ export const QuerySchema = z.object({ | ||
| 114 | 114 | "created": z.coerce.date(), |
| 115 | 115 | "lang": z.string(), |
| 116 | 116 | "results": ResultsSchema, |
| 117 | -}); | |
| 117 | +}).strict(); | |
| 118 | 118 | export type Query = z.infer<typeof QuerySchema>; |
| 119 | 119 | |
| 120 | 120 | export const TopLevelSchema = z.object({ |
| 121 | 121 | "query": QuerySchema, |
| 122 | -}); | |
| 122 | +}).strict(); | |
| 123 | 123 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/e2a58.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -4,7 +4,7 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TopLevelElementSchema = z.object({ |
| 5 | 5 | "date": z.string(), |
| 6 | 6 | "stop-and-search": z.array(z.string()), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +13 −13test/inputs/json/misc/e324e.json
Mtypescript-zoddefault / TopLevel.ts+13 −13
| @@ -9,14 +9,14 @@ export type Type = z.infer<typeof TypeSchema>; | ||
| 9 | 9 | export const PropertySchema = z.object({ |
| 10 | 10 | "description": z.string(), |
| 11 | 11 | "type": TypeSchema, |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type Property = z.infer<typeof PropertySchema>; |
| 14 | 14 | |
| 15 | 15 | export const InfoSchema = z.object({ |
| 16 | 16 | "description": z.string(), |
| 17 | 17 | "title": z.string(), |
| 18 | 18 | "version": z.string(), |
| 19 | -}); | |
| 19 | +}).strict(); | |
| 20 | 20 | export type Info = z.infer<typeof InfoSchema>; |
| 21 | 21 | |
| 22 | 22 | export const ParameterSchema = z.object({ |
| @@ -26,39 +26,39 @@ export const ParameterSchema = z.object({ | ||
| 26 | 26 | "name": z.string(), |
| 27 | 27 | "required": z.boolean(), |
| 28 | 28 | "type": TypeSchema, |
| 29 | -}); | |
| 29 | +}).strict(); | |
| 30 | 30 | export type Parameter = z.infer<typeof ParameterSchema>; |
| 31 | 31 | |
| 32 | 32 | export const ItemsSchema = z.object({ |
| 33 | 33 | "$ref": z.string(), |
| 34 | -}); | |
| 34 | +}).strict(); | |
| 35 | 35 | export type Items = z.infer<typeof ItemsSchema>; |
| 36 | 36 | |
| 37 | 37 | export const RateSchema = z.object({ |
| 38 | 38 | "properties": z.record(z.string(), PropertySchema), |
| 39 | -}); | |
| 39 | +}).strict(); | |
| 40 | 40 | export type Rate = z.infer<typeof RateSchema>; |
| 41 | 41 | |
| 42 | 42 | export const SchemaSchema = z.object({ |
| 43 | 43 | "items": ItemsSchema, |
| 44 | 44 | "type": z.string(), |
| 45 | -}); | |
| 45 | +}).strict(); | |
| 46 | 46 | export type Schema = z.infer<typeof SchemaSchema>; |
| 47 | 47 | |
| 48 | 48 | export const DefinitionsSchema = z.object({ |
| 49 | 49 | "Rate": RateSchema, |
| 50 | -}); | |
| 50 | +}).strict(); | |
| 51 | 51 | export type Definitions = z.infer<typeof DefinitionsSchema>; |
| 52 | 52 | |
| 53 | 53 | export const The200Schema = z.object({ |
| 54 | 54 | "description": z.string(), |
| 55 | 55 | "schema": SchemaSchema, |
| 56 | -}); | |
| 56 | +}).strict(); | |
| 57 | 57 | export type The200 = z.infer<typeof The200Schema>; |
| 58 | 58 | |
| 59 | 59 | export const ResponsesSchema = z.object({ |
| 60 | 60 | "200": The200Schema, |
| 61 | -}); | |
| 61 | +}).strict(); | |
| 62 | 62 | export type Responses = z.infer<typeof ResponsesSchema>; |
| 63 | 63 | |
| 64 | 64 | export const GetSchema = z.object({ |
| @@ -67,17 +67,17 @@ export const GetSchema = z.object({ | ||
| 67 | 67 | "responses": ResponsesSchema, |
| 68 | 68 | "summary": z.string(), |
| 69 | 69 | "tags": z.array(z.string()), |
| 70 | -}); | |
| 70 | +}).strict(); | |
| 71 | 71 | export type Get = z.infer<typeof GetSchema>; |
| 72 | 72 | |
| 73 | 73 | export const TariffRatesSearchSchema = z.object({ |
| 74 | 74 | "get": GetSchema, |
| 75 | -}); | |
| 75 | +}).strict(); | |
| 76 | 76 | export type TariffRatesSearch = z.infer<typeof TariffRatesSearchSchema>; |
| 77 | 77 | |
| 78 | 78 | export const PathsSchema = z.object({ |
| 79 | 79 | "/tariff_rates/search": TariffRatesSearchSchema, |
| 80 | -}); | |
| 80 | +}).strict(); | |
| 81 | 81 | export type Paths = z.infer<typeof PathsSchema>; |
| 82 | 82 | |
| 83 | 83 | export const TopLevelSchema = z.object({ |
| @@ -89,5 +89,5 @@ export const TopLevelSchema = z.object({ | ||
| 89 | 89 | "produces": z.array(z.string()), |
| 90 | 90 | "schemes": z.array(z.string()), |
| 91 | 91 | "swagger": z.string(), |
| 92 | -}); | |
| 92 | +}).strict(); | |
| 93 | 93 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +3 −3test/inputs/json/misc/e53b5.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -17,7 +17,7 @@ export type Value = z.infer<typeof ValueSchema>; | ||
| 17 | 17 | export const CountrySchema = z.object({ |
| 18 | 18 | "id": IdSchema, |
| 19 | 19 | "value": ValueSchema, |
| 20 | -}); | |
| 20 | +}).strict(); | |
| 21 | 21 | export type Country = z.infer<typeof CountrySchema>; |
| 22 | 22 | |
| 23 | 23 | export const FluffyTopLevelSchema = z.object({ |
| @@ -25,7 +25,7 @@ export const FluffyTopLevelSchema = z.object({ | ||
| 25 | 25 | "pages": z.number().int(), |
| 26 | 26 | "per_page": z.string().regex(/^-?\d+$/), |
| 27 | 27 | "total": z.number().int(), |
| 28 | -}); | |
| 28 | +}).strict(); | |
| 29 | 29 | export type FluffyTopLevel = z.infer<typeof FluffyTopLevelSchema>; |
| 30 | 30 | |
| 31 | 31 | export const PurpleTopLevelSchema = z.object({ |
| @@ -34,7 +34,7 @@ export const PurpleTopLevelSchema = z.object({ | ||
| 34 | 34 | "decimal": z.string().regex(/^-?\d+$/), |
| 35 | 35 | "indicator": CountrySchema, |
| 36 | 36 | "value": z.string().regex(/^-?\d+$/), |
| 37 | -}); | |
| 37 | +}).strict(); | |
| 38 | 38 | export type PurpleTopLevel = z.infer<typeof PurpleTopLevelSchema>; |
| 39 | 39 | |
| 40 | 40 | export const TopLevelSchema = z.array(z.union([z.array(PurpleTopLevelSchema), FluffyTopLevelSchema])); |
Test case
1 generated file · +3 −3test/inputs/json/misc/e64a0.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -2,7 +2,7 @@ import * as z from "zod"; | ||
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | export const ArgsSchema = z.object({ |
| 5 | -}); | |
| 5 | +}).strict(); | |
| 6 | 6 | export type Args = z.infer<typeof ArgsSchema>; |
| 7 | 7 | |
| 8 | 8 | export const HeadersSchema = z.object({ |
| @@ -10,7 +10,7 @@ export const HeadersSchema = z.object({ | ||
| 10 | 10 | "Connection": z.string(), |
| 11 | 11 | "Host": z.string(), |
| 12 | 12 | "User-Agent": z.string(), |
| 13 | -}); | |
| 13 | +}).strict(); | |
| 14 | 14 | export type Headers = z.infer<typeof HeadersSchema>; |
| 15 | 15 | |
| 16 | 16 | export const TopLevelSchema = z.object({ |
| @@ -18,5 +18,5 @@ export const TopLevelSchema = z.object({ | ||
| 18 | 18 | "headers": HeadersSchema, |
| 19 | 19 | "origin": z.string(), |
| 20 | 20 | "url": z.string(), |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/e8a0b.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -13,7 +13,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 13 | 13 | "males": z.number().int(), |
| 14 | 14 | "total": z.number().int(), |
| 15 | 15 | "year": z.number().int(), |
| 16 | -}); | |
| 16 | +}).strict(); | |
| 17 | 17 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 18 | 18 | |
| 19 | 19 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +28 −28test/inputs/json/misc/e8b04.json
Mtypescript-zoddefault / TopLevel.ts+28 −28
| @@ -133,61 +133,61 @@ export const GrantSchema = z.object({ | ||
| 133 | 133 | "flags": z.array(GrantFlagSchema), |
| 134 | 134 | "inherited": z.boolean(), |
| 135 | 135 | "type": GrantTypeSchema, |
| 136 | -}); | |
| 136 | +}).strict(); | |
| 137 | 137 | export type Grant = z.infer<typeof GrantSchema>; |
| 138 | 138 | |
| 139 | 139 | export const TestSchema = z.object({ |
| 140 | 140 | "CFPB1": z.string(), |
| 141 | -}); | |
| 141 | +}).strict(); | |
| 142 | 142 | export type Test = z.infer<typeof TestSchema>; |
| 143 | 143 | |
| 144 | 144 | export const GroupSchema = z.object({ |
| 145 | 145 | "columnFieldName": z.string(), |
| 146 | -}); | |
| 146 | +}).strict(); | |
| 147 | 147 | export type Group = z.infer<typeof GroupSchema>; |
| 148 | 148 | |
| 149 | 149 | export const OrderSchema = z.object({ |
| 150 | 150 | "ascending": z.boolean(), |
| 151 | 151 | "columnFieldName": OrderColumnFieldNameSchema, |
| 152 | -}); | |
| 152 | +}).strict(); | |
| 153 | 153 | export type Order = z.infer<typeof OrderSchema>; |
| 154 | 154 | |
| 155 | 155 | export const SelectSchema = z.object({ |
| 156 | 156 | "aggregate": z.string().optional(), |
| 157 | 157 | "columnFieldName": z.string(), |
| 158 | -}); | |
| 158 | +}).strict(); | |
| 159 | 159 | export type Select = z.infer<typeof SelectSchema>; |
| 160 | 160 | |
| 161 | 161 | export const TableColumnIdSchema = z.object({ |
| 162 | 162 | "2819740": z.number().int(), |
| 163 | -}); | |
| 163 | +}).strict(); | |
| 164 | 164 | export type TableColumnId = z.infer<typeof TableColumnIdSchema>; |
| 165 | 165 | |
| 166 | 166 | export const PurpleVisibleSchema = z.object({ |
| 167 | 167 | "fatrow": z.boolean().optional(), |
| 168 | 168 | "table": z.boolean().optional(), |
| 169 | -}); | |
| 169 | +}).strict(); | |
| 170 | 170 | export type PurpleVisible = z.infer<typeof PurpleVisibleSchema>; |
| 171 | 171 | |
| 172 | 172 | export const FieldSchema = z.object({ |
| 173 | 173 | "tableColumnId": z.number().int(), |
| 174 | 174 | "type": FieldTypeSchema, |
| 175 | -}); | |
| 175 | +}).strict(); | |
| 176 | 176 | export type Field = z.infer<typeof FieldSchema>; |
| 177 | 177 | |
| 178 | 178 | export const StylesSchema = z.object({ |
| 179 | 179 | "width": WidthSchema, |
| 180 | -}); | |
| 180 | +}).strict(); | |
| 181 | 181 | export type Styles = z.infer<typeof StylesSchema>; |
| 182 | 182 | |
| 183 | 183 | export const AccessPointsSchema = z.object({ |
| 184 | 184 | "new_view": z.string(), |
| 185 | -}); | |
| 185 | +}).strict(); | |
| 186 | 186 | export type AccessPoints = z.infer<typeof AccessPointsSchema>; |
| 187 | 187 | |
| 188 | 188 | export const FluffyVisibleSchema = z.object({ |
| 189 | 189 | "href": z.boolean(), |
| 190 | -}); | |
| 190 | +}).strict(); | |
| 191 | 191 | export type FluffyVisible = z.infer<typeof FluffyVisibleSchema>; |
| 192 | 192 | |
| 193 | 193 | export const OwnerSchema = z.object({ |
| @@ -201,12 +201,12 @@ export const OwnerSchema = z.object({ | ||
| 201 | 201 | "rights": z.array(z.string()).optional(), |
| 202 | 202 | "roleName": RoleNameSchema.optional(), |
| 203 | 203 | "screenName": z.string(), |
| 204 | -}); | |
| 204 | +}).strict(); | |
| 205 | 205 | export type Owner = z.infer<typeof OwnerSchema>; |
| 206 | 206 | |
| 207 | 207 | export const RatingsSchema = z.object({ |
| 208 | 208 | "rating": z.number().int(), |
| 209 | -}); | |
| 209 | +}).strict(); | |
| 210 | 210 | export type Ratings = z.infer<typeof RatingsSchema>; |
| 211 | 211 | |
| 212 | 212 | export const TableAuthorSchema = z.object({ |
| @@ -215,12 +215,12 @@ export const TableAuthorSchema = z.object({ | ||
| 215 | 215 | "rights": z.array(z.string()).optional(), |
| 216 | 216 | "roleName": RoleNameSchema.optional(), |
| 217 | 217 | "screenName": z.string(), |
| 218 | -}); | |
| 218 | +}).strict(); | |
| 219 | 219 | export type TableAuthor = z.infer<typeof TableAuthorSchema>; |
| 220 | 220 | |
| 221 | 221 | export const CustomFieldsSchema = z.object({ |
| 222 | 222 | "TEST": TestSchema, |
| 223 | -}); | |
| 223 | +}).strict(); | |
| 224 | 224 | export type CustomFields = z.infer<typeof CustomFieldsSchema>; |
| 225 | 225 | |
| 226 | 226 | export const ChildMetadataSchema = z.object({ |
| @@ -230,22 +230,22 @@ export const ChildMetadataSchema = z.object({ | ||
| 230 | 230 | "operator": MetadataOperatorSchema.optional(), |
| 231 | 231 | "tableColumnId": TableColumnIdSchema.optional(), |
| 232 | 232 | "unifiedVersion": z.number().int().optional(), |
| 233 | -}); | |
| 233 | +}).strict(); | |
| 234 | 234 | export type ChildMetadata = z.infer<typeof ChildMetadataSchema>; |
| 235 | 235 | |
| 236 | 236 | export const MetadataRenderTypeConfigSchema = z.object({ |
| 237 | 237 | "visible": PurpleVisibleSchema, |
| 238 | -}); | |
| 238 | +}).strict(); | |
| 239 | 239 | export type MetadataRenderTypeConfig = z.infer<typeof MetadataRenderTypeConfigSchema>; |
| 240 | 240 | |
| 241 | 241 | export const RowSchema = z.object({ |
| 242 | 242 | "fields": z.array(FieldSchema), |
| 243 | -}); | |
| 243 | +}).strict(); | |
| 244 | 244 | export type Row = z.infer<typeof RowSchema>; |
| 245 | 245 | |
| 246 | 246 | export const V1ArchivedPropertiesRenderTypeConfigSchema = z.object({ |
| 247 | 247 | "visible": FluffyVisibleSchema, |
| 248 | -}); | |
| 248 | +}).strict(); | |
| 249 | 249 | export type V1ArchivedPropertiesRenderTypeConfig = z.infer<typeof V1ArchivedPropertiesRenderTypeConfigSchema>; |
| 250 | 250 | |
| 251 | 251 | export const ChildSchema = z.object({ |
| @@ -253,20 +253,20 @@ export const ChildSchema = z.object({ | ||
| 253 | 253 | "metadata": ChildMetadataSchema.optional(), |
| 254 | 254 | "operator": ChildOperatorSchema, |
| 255 | 255 | "value": z.string().optional(), |
| 256 | -}); | |
| 256 | +}).strict(); | |
| 257 | 257 | export type Child = z.infer<typeof ChildSchema>; |
| 258 | 258 | |
| 259 | 259 | export const ColumnSchema = z.object({ |
| 260 | 260 | "rows": z.array(RowSchema), |
| 261 | 261 | "styles": StylesSchema, |
| 262 | -}); | |
| 262 | +}).strict(); | |
| 263 | 263 | export type Column = z.infer<typeof ColumnSchema>; |
| 264 | 264 | |
| 265 | 265 | export const V1ArchivedPropertiesSchema = z.object({ |
| 266 | 266 | "accessPoints": AccessPointsSchema, |
| 267 | 267 | "blist_id": z.string().regex(/^-?\d+$/), |
| 268 | 268 | "renderTypeConfig": V1ArchivedPropertiesRenderTypeConfigSchema, |
| 269 | -}); | |
| 269 | +}).strict(); | |
| 270 | 270 | export type V1ArchivedProperties = z.infer<typeof V1ArchivedPropertiesSchema>; |
| 271 | 271 | |
| 272 | 272 | export const WhereSchema = z.object({ |
| @@ -275,12 +275,12 @@ export const WhereSchema = z.object({ | ||
| 275 | 275 | "metadata": ChildMetadataSchema.optional(), |
| 276 | 276 | "operator": WhereOperatorSchema, |
| 277 | 277 | "value": z.string().optional(), |
| 278 | -}); | |
| 278 | +}).strict(); | |
| 279 | 279 | export type Where = z.infer<typeof WhereSchema>; |
| 280 | 280 | |
| 281 | 281 | export const FatRowSchema = z.object({ |
| 282 | 282 | "columns": z.array(ColumnSchema), |
| 283 | -}); | |
| 283 | +}).strict(); | |
| 284 | 284 | export type FatRow = z.infer<typeof FatRowSchema>; |
| 285 | 285 | |
| 286 | 286 | export const JsonQuerySchema = z.object({ |
| @@ -288,12 +288,12 @@ export const JsonQuerySchema = z.object({ | ||
| 288 | 288 | "order": z.array(OrderSchema).optional(), |
| 289 | 289 | "select": z.array(SelectSchema).optional(), |
| 290 | 290 | "where": WhereSchema.optional(), |
| 291 | -}); | |
| 291 | +}).strict(); | |
| 292 | 292 | export type JsonQuery = z.infer<typeof JsonQuerySchema>; |
| 293 | 293 | |
| 294 | 294 | export const RichRendererConfigsSchema = z.object({ |
| 295 | 295 | "fatRow": FatRowSchema, |
| 296 | -}); | |
| 296 | +}).strict(); | |
| 297 | 297 | export type RichRendererConfigs = z.infer<typeof RichRendererConfigsSchema>; |
| 298 | 298 | |
| 299 | 299 | export const TopLevelMetadataSchema = z.object({ |
| @@ -307,7 +307,7 @@ export const TopLevelMetadataSchema = z.object({ | ||
| 307 | 307 | "rowIdentifier": z.string().optional(), |
| 308 | 308 | "rowLabel": z.string().optional(), |
| 309 | 309 | "v1_archived_properties": V1ArchivedPropertiesSchema.optional(), |
| 310 | -}); | |
| 310 | +}).strict(); | |
| 311 | 311 | export type TopLevelMetadata = z.infer<typeof TopLevelMetadataSchema>; |
| 312 | 312 | |
| 313 | 313 | export const TopLevelElementSchema = z.object({ |
| @@ -351,7 +351,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 351 | 351 | "viewCount": z.number().int(), |
| 352 | 352 | "viewLastModified": z.number().int(), |
| 353 | 353 | "viewType": ViewTypeSchema, |
| 354 | -}); | |
| 354 | +}).strict(); | |
| 355 | 355 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 356 | 356 | |
| 357 | 357 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +5 −5test/inputs/json/misc/f22f5.json
Mtypescript-zoddefault / TopLevel.ts+5 −5
| @@ -31,7 +31,7 @@ export const KindSchema = z.enum([ | ||
| 31 | 31 | export type Kind = z.infer<typeof KindSchema>; |
| 32 | 32 | |
| 33 | 33 | export const MediaEmbedSchema = z.object({ |
| 34 | -}); | |
| 34 | +}).strict(); | |
| 35 | 35 | export type MediaEmbed = z.infer<typeof MediaEmbedSchema>; |
| 36 | 36 | |
| 37 | 37 | export const ChildDataSchema = z.object({ |
| @@ -95,13 +95,13 @@ export const ChildDataSchema = z.object({ | ||
| 95 | 95 | "user_reports": z.array(z.any()), |
| 96 | 96 | "view_count": z.null(), |
| 97 | 97 | "visited": z.boolean(), |
| 98 | -}); | |
| 98 | +}).strict(); | |
| 99 | 99 | export type ChildData = z.infer<typeof ChildDataSchema>; |
| 100 | 100 | |
| 101 | 101 | export const ChildSchema = z.object({ |
| 102 | 102 | "data": ChildDataSchema, |
| 103 | 103 | "kind": KindSchema, |
| 104 | -}); | |
| 104 | +}).strict(); | |
| 105 | 105 | export type Child = z.infer<typeof ChildSchema>; |
| 106 | 106 | |
| 107 | 107 | export const TopLevelDataSchema = z.object({ |
| @@ -109,11 +109,11 @@ export const TopLevelDataSchema = z.object({ | ||
| 109 | 109 | "before": z.null(), |
| 110 | 110 | "children": z.array(ChildSchema), |
| 111 | 111 | "modhash": z.string(), |
| 112 | -}); | |
| 112 | +}).strict(); | |
| 113 | 113 | export type TopLevelData = z.infer<typeof TopLevelDataSchema>; |
| 114 | 114 | |
| 115 | 115 | export const TopLevelSchema = z.object({ |
| 116 | 116 | "data": TopLevelDataSchema, |
| 117 | 117 | "kind": z.string(), |
| 118 | -}); | |
| 118 | +}).strict(); | |
| 119 | 119 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/f3139.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -4,7 +4,7 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TopLevelElementSchema = z.object({ |
| 5 | 5 | "id": z.string(), |
| 6 | 6 | "name": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +1 −1test/inputs/json/misc/f3edf.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -13,7 +13,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 13 | 13 | "males": z.number().int(), |
| 14 | 14 | "total": z.number().int(), |
| 15 | 15 | "year": z.number().int(), |
| 16 | -}); | |
| 16 | +}).strict(); | |
| 17 | 17 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 18 | 18 | |
| 19 | 19 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +1 −1test/inputs/json/misc/f466a.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -13,7 +13,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 13 | 13 | "males": z.number().int(), |
| 14 | 14 | "total": z.number().int(), |
| 15 | 15 | "year": z.number().int(), |
| 16 | -}); | |
| 16 | +}).strict(); | |
| 17 | 17 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 18 | 18 | |
| 19 | 19 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +10 −10test/inputs/json/misc/f6a65.json
Mtypescript-zoddefault / TopLevel.ts+10 −10
| @@ -29,7 +29,7 @@ export const The480_WStillSchema = z.object({ | ||
| 29 | 29 | "size": z.string().regex(/^-?\d+$/).optional(), |
| 30 | 30 | "url": z.string(), |
| 31 | 31 | "width": z.string().regex(/^-?\d+$/), |
| 32 | -}); | |
| 32 | +}).strict(); | |
| 33 | 33 | export type The480_WStill = z.infer<typeof The480_WStillSchema>; |
| 34 | 34 | |
| 35 | 35 | export const DownsizedSmallSchema = z.object({ |
| @@ -37,7 +37,7 @@ export const DownsizedSmallSchema = z.object({ | ||
| 37 | 37 | "mp4": z.string(), |
| 38 | 38 | "mp4_size": z.string().regex(/^-?\d+$/), |
| 39 | 39 | "width": z.string().regex(/^-?\d+$/), |
| 40 | -}); | |
| 40 | +}).strict(); | |
| 41 | 41 | export type DownsizedSmall = z.infer<typeof DownsizedSmallSchema>; |
| 42 | 42 | |
| 43 | 43 | export const FixedHeightSchema = z.object({ |
| @@ -51,13 +51,13 @@ export const FixedHeightSchema = z.object({ | ||
| 51 | 51 | "webp": z.string(), |
| 52 | 52 | "webp_size": z.string().regex(/^-?\d+$/), |
| 53 | 53 | "width": z.string().regex(/^-?\d+$/), |
| 54 | -}); | |
| 54 | +}).strict(); | |
| 55 | 55 | export type FixedHeight = z.infer<typeof FixedHeightSchema>; |
| 56 | 56 | |
| 57 | 57 | export const LoopingSchema = z.object({ |
| 58 | 58 | "mp4": z.string(), |
| 59 | 59 | "mp4_size": z.string().regex(/^-?\d+$/), |
| 60 | -}); | |
| 60 | +}).strict(); | |
| 61 | 61 | export type Looping = z.infer<typeof LoopingSchema>; |
| 62 | 62 | |
| 63 | 63 | export const UserSchema = z.object({ |
| @@ -67,21 +67,21 @@ export const UserSchema = z.object({ | ||
| 67 | 67 | "profile_url": z.string(), |
| 68 | 68 | "twitter": z.string(), |
| 69 | 69 | "username": UsernameSchema, |
| 70 | -}); | |
| 70 | +}).strict(); | |
| 71 | 71 | export type User = z.infer<typeof UserSchema>; |
| 72 | 72 | |
| 73 | 73 | export const MetaSchema = z.object({ |
| 74 | 74 | "msg": z.string(), |
| 75 | 75 | "response_id": z.string(), |
| 76 | 76 | "status": z.number().int(), |
| 77 | -}); | |
| 77 | +}).strict(); | |
| 78 | 78 | export type Meta = z.infer<typeof MetaSchema>; |
| 79 | 79 | |
| 80 | 80 | export const PaginationSchema = z.object({ |
| 81 | 81 | "count": z.number().int(), |
| 82 | 82 | "offset": z.number().int(), |
| 83 | 83 | "total_count": z.number().int(), |
| 84 | -}); | |
| 84 | +}).strict(); | |
| 85 | 85 | export type Pagination = z.infer<typeof PaginationSchema>; |
| 86 | 86 | |
| 87 | 87 | export const ImagesSchema = z.object({ |
| @@ -108,7 +108,7 @@ export const ImagesSchema = z.object({ | ||
| 108 | 108 | "preview_gif": The480_WStillSchema, |
| 109 | 109 | "preview_webp": The480_WStillSchema, |
| 110 | 110 | "480w_still": The480_WStillSchema.optional(), |
| 111 | -}); | |
| 111 | +}).strict(); | |
| 112 | 112 | export type Images = z.infer<typeof ImagesSchema>; |
| 113 | 113 | |
| 114 | 114 | export const DatumSchema = z.object({ |
| @@ -130,12 +130,12 @@ export const DatumSchema = z.object({ | ||
| 130 | 130 | "url": z.string(), |
| 131 | 131 | "user": UserSchema.optional(), |
| 132 | 132 | "username": UsernameSchema, |
| 133 | -}); | |
| 133 | +}).strict(); | |
| 134 | 134 | export type Datum = z.infer<typeof DatumSchema>; |
| 135 | 135 | |
| 136 | 136 | export const TopLevelSchema = z.object({ |
| 137 | 137 | "data": z.array(DatumSchema), |
| 138 | 138 | "meta": MetaSchema, |
| 139 | 139 | "pagination": PaginationSchema, |
| 140 | -}); | |
| 140 | +}).strict(); | |
| 141 | 141 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +13 −13test/inputs/json/misc/f74d5.json
Mtypescript-zoddefault / TopLevel.ts+13 −13
| @@ -11,35 +11,35 @@ export type TypeName = z.infer<typeof TypeNameSchema>; | ||
| 11 | 11 | export const TopSchema = z.object({ |
| 12 | 12 | "count": z.number().int(), |
| 13 | 13 | "item": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Top = z.infer<typeof TopSchema>; |
| 16 | 16 | |
| 17 | 17 | export const QuerySchema = z.object({ |
| 18 | -}); | |
| 18 | +}).strict(); | |
| 19 | 19 | export type Query = z.infer<typeof QuerySchema>; |
| 20 | 20 | |
| 21 | 21 | export const GrantSchema = z.object({ |
| 22 | 22 | "flags": z.array(z.string()), |
| 23 | 23 | "inherited": z.boolean(), |
| 24 | 24 | "type": z.string(), |
| 25 | -}); | |
| 25 | +}).strict(); | |
| 26 | 26 | export type Grant = z.infer<typeof GrantSchema>; |
| 27 | 27 | |
| 28 | 28 | export const LicenseSchema = z.object({ |
| 29 | 29 | "name": z.string(), |
| 30 | -}); | |
| 30 | +}).strict(); | |
| 31 | 31 | export type License = z.infer<typeof LicenseSchema>; |
| 32 | 32 | |
| 33 | 33 | export const VisibleSchema = z.object({ |
| 34 | 34 | "table": z.boolean(), |
| 35 | -}); | |
| 35 | +}).strict(); | |
| 36 | 36 | export type Visible = z.infer<typeof VisibleSchema>; |
| 37 | 37 | |
| 38 | 38 | export const OwnerSchema = z.object({ |
| 39 | 39 | "displayName": z.string(), |
| 40 | 40 | "id": z.string(), |
| 41 | 41 | "screenName": z.string(), |
| 42 | -}); | |
| 42 | +}).strict(); | |
| 43 | 43 | export type Owner = z.infer<typeof OwnerSchema>; |
| 44 | 44 | |
| 45 | 45 | export const CachedContentsSchema = z.object({ |
| @@ -50,12 +50,12 @@ export const CachedContentsSchema = z.object({ | ||
| 50 | 50 | "smallest": z.string(), |
| 51 | 51 | "sum": z.string().regex(/^-?\d+$/).optional(), |
| 52 | 52 | "top": z.array(TopSchema), |
| 53 | -}); | |
| 53 | +}).strict(); | |
| 54 | 54 | export type CachedContents = z.infer<typeof CachedContentsSchema>; |
| 55 | 55 | |
| 56 | 56 | export const RenderTypeConfigSchema = z.object({ |
| 57 | 57 | "visible": VisibleSchema, |
| 58 | -}); | |
| 58 | +}).strict(); | |
| 59 | 59 | export type RenderTypeConfig = z.infer<typeof RenderTypeConfigSchema>; |
| 60 | 60 | |
| 61 | 61 | export const ColumnSchema = z.object({ |
| @@ -70,7 +70,7 @@ export const ColumnSchema = z.object({ | ||
| 70 | 70 | "renderTypeName": TypeNameSchema, |
| 71 | 71 | "tableColumnId": z.number().int().optional(), |
| 72 | 72 | "width": z.number().int().optional(), |
| 73 | -}); | |
| 73 | +}).strict(); | |
| 74 | 74 | export type Column = z.infer<typeof ColumnSchema>; |
| 75 | 75 | |
| 76 | 76 | export const MetadataSchema = z.object({ |
| @@ -79,7 +79,7 @@ export const MetadataSchema = z.object({ | ||
| 79 | 79 | "rdfSubject": z.string().regex(/^-?\d+$/), |
| 80 | 80 | "renderTypeConfig": RenderTypeConfigSchema, |
| 81 | 81 | "rowIdentifier": z.string().regex(/^-?\d+$/), |
| 82 | -}); | |
| 82 | +}).strict(); | |
| 83 | 83 | export type Metadata = z.infer<typeof MetadataSchema>; |
| 84 | 84 | |
| 85 | 85 | export const ViewSchema = z.object({ |
| @@ -120,16 +120,16 @@ export const ViewSchema = z.object({ | ||
| 120 | 120 | "viewCount": z.number().int(), |
| 121 | 121 | "viewLastModified": z.number().int(), |
| 122 | 122 | "viewType": z.string(), |
| 123 | -}); | |
| 123 | +}).strict(); | |
| 124 | 124 | export type View = z.infer<typeof ViewSchema>; |
| 125 | 125 | |
| 126 | 126 | export const MetaSchema = z.object({ |
| 127 | 127 | "view": ViewSchema, |
| 128 | -}); | |
| 128 | +}).strict(); | |
| 129 | 129 | export type Meta = z.infer<typeof MetaSchema>; |
| 130 | 130 | |
| 131 | 131 | export const TopLevelSchema = z.object({ |
| 132 | 132 | "data": z.array(z.array(z.union([z.number().int(), z.string()]))), |
| 133 | 133 | "meta": MetaSchema, |
| 134 | -}); | |
| 134 | +}).strict(); | |
| 135 | 135 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +14 −14test/inputs/json/misc/f82d9.json
Mtypescript-zoddefault / TopLevel.ts+14 −14
| @@ -9,14 +9,14 @@ export type Type = z.infer<typeof TypeSchema>; | ||
| 9 | 9 | export const ClickUrlSchema = z.object({ |
| 10 | 10 | "description": z.string(), |
| 11 | 11 | "type": TypeSchema, |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type ClickUrl = z.infer<typeof ClickUrlSchema>; |
| 14 | 14 | |
| 15 | 15 | export const InfoSchema = z.object({ |
| 16 | 16 | "description": z.string(), |
| 17 | 17 | "title": z.string(), |
| 18 | 18 | "version": z.string(), |
| 19 | -}); | |
| 19 | +}).strict(); | |
| 20 | 20 | export type Info = z.infer<typeof InfoSchema>; |
| 21 | 21 | |
| 22 | 22 | export const ParameterSchema = z.object({ |
| @@ -26,12 +26,12 @@ export const ParameterSchema = z.object({ | ||
| 26 | 26 | "name": z.string(), |
| 27 | 27 | "required": z.boolean(), |
| 28 | 28 | "type": TypeSchema, |
| 29 | -}); | |
| 29 | +}).strict(); | |
| 30 | 30 | export type Parameter = z.infer<typeof ParameterSchema>; |
| 31 | 31 | |
| 32 | 32 | export const ItemsSchema = z.object({ |
| 33 | 33 | "$ref": z.string(), |
| 34 | -}); | |
| 34 | +}).strict(); | |
| 35 | 35 | export type Items = z.infer<typeof ItemsSchema>; |
| 36 | 36 | |
| 37 | 37 | export const PropertiesSchema = z.object({ |
| @@ -45,34 +45,34 @@ export const PropertiesSchema = z.object({ | ||
| 45 | 45 | "source_industry": ClickUrlSchema, |
| 46 | 46 | "title": ClickUrlSchema, |
| 47 | 47 | "url": ClickUrlSchema, |
| 48 | -}); | |
| 48 | +}).strict(); | |
| 49 | 49 | export type Properties = z.infer<typeof PropertiesSchema>; |
| 50 | 50 | |
| 51 | 51 | export const SchemaSchema = z.object({ |
| 52 | 52 | "items": ItemsSchema, |
| 53 | 53 | "type": z.string(), |
| 54 | -}); | |
| 54 | +}).strict(); | |
| 55 | 55 | export type Schema = z.infer<typeof SchemaSchema>; |
| 56 | 56 | |
| 57 | 57 | export const ReportSchema = z.object({ |
| 58 | 58 | "properties": PropertiesSchema, |
| 59 | -}); | |
| 59 | +}).strict(); | |
| 60 | 60 | export type Report = z.infer<typeof ReportSchema>; |
| 61 | 61 | |
| 62 | 62 | export const The200Schema = z.object({ |
| 63 | 63 | "description": z.string(), |
| 64 | 64 | "schema": SchemaSchema, |
| 65 | -}); | |
| 65 | +}).strict(); | |
| 66 | 66 | export type The200 = z.infer<typeof The200Schema>; |
| 67 | 67 | |
| 68 | 68 | export const DefinitionsSchema = z.object({ |
| 69 | 69 | "Report": ReportSchema, |
| 70 | -}); | |
| 70 | +}).strict(); | |
| 71 | 71 | export type Definitions = z.infer<typeof DefinitionsSchema>; |
| 72 | 72 | |
| 73 | 73 | export const ResponsesSchema = z.object({ |
| 74 | 74 | "200": The200Schema, |
| 75 | -}); | |
| 75 | +}).strict(); | |
| 76 | 76 | export type Responses = z.infer<typeof ResponsesSchema>; |
| 77 | 77 | |
| 78 | 78 | export const GetSchema = z.object({ |
| @@ -81,17 +81,17 @@ export const GetSchema = z.object({ | ||
| 81 | 81 | "responses": ResponsesSchema, |
| 82 | 82 | "summary": z.string(), |
| 83 | 83 | "tags": z.array(z.string()), |
| 84 | -}); | |
| 84 | +}).strict(); | |
| 85 | 85 | export type Get = z.infer<typeof GetSchema>; |
| 86 | 86 | |
| 87 | 87 | export const MarketResearchLibrarySearchSchema = z.object({ |
| 88 | 88 | "get": GetSchema, |
| 89 | -}); | |
| 89 | +}).strict(); | |
| 90 | 90 | export type MarketResearchLibrarySearch = z.infer<typeof MarketResearchLibrarySearchSchema>; |
| 91 | 91 | |
| 92 | 92 | export const PathsSchema = z.object({ |
| 93 | 93 | "/market_research_library/search": MarketResearchLibrarySearchSchema, |
| 94 | -}); | |
| 94 | +}).strict(); | |
| 95 | 95 | export type Paths = z.infer<typeof PathsSchema>; |
| 96 | 96 | |
| 97 | 97 | export const TopLevelSchema = z.object({ |
| @@ -103,5 +103,5 @@ export const TopLevelSchema = z.object({ | ||
| 103 | 103 | "produces": z.array(z.string()), |
| 104 | 104 | "schemes": z.array(z.string()), |
| 105 | 105 | "swagger": z.string(), |
| 106 | -}); | |
| 106 | +}).strict(); | |
| 107 | 107 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/misc/f974d.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -7,5 +7,5 @@ export const TopLevelSchema = z.object({ | ||
| 7 | 7 | "height": z.number().int(), |
| 8 | 8 | "time": z.number().int(), |
| 9 | 9 | "txIndexes": z.array(z.number().int()), |
| 10 | -}); | |
| 10 | +}).strict(); | |
| 11 | 11 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/json/misc/faff5.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -4,10 +4,10 @@ import * as z from "zod"; | ||
| 4 | 4 | export const ResponseSchema = z.object({ |
| 5 | 5 | "player_count": z.number().int(), |
| 6 | 6 | "result": z.number().int(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Response = z.infer<typeof ResponseSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "response": ResponseSchema, |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +28 −28test/inputs/json/misc/fcca3.json
Mtypescript-zoddefault / TopLevel.ts+28 −28
| @@ -11,21 +11,21 @@ export type TypeName = z.infer<typeof TypeNameSchema>; | ||
| 11 | 11 | export const TopSchema = z.object({ |
| 12 | 12 | "count": z.number().int(), |
| 13 | 13 | "item": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type Top = z.infer<typeof TopSchema>; |
| 16 | 16 | |
| 17 | 17 | export const FormatSchema = z.object({ |
| 18 | 18 | "align": z.string().optional(), |
| 19 | 19 | "noCommas": z.enum(["true", "false"]).optional(), |
| 20 | 20 | "precisionStyle": z.string().optional(), |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type Format = z.infer<typeof FormatSchema>; |
| 23 | 23 | |
| 24 | 24 | export const GrantSchema = z.object({ |
| 25 | 25 | "flags": z.array(z.string()), |
| 26 | 26 | "inherited": z.boolean(), |
| 27 | 27 | "type": z.string(), |
| 28 | -}); | |
| 28 | +}).strict(); | |
| 29 | 29 | export type Grant = z.infer<typeof GrantSchema>; |
| 30 | 30 | |
| 31 | 31 | export const AttachmentSchema = z.object({ |
| @@ -33,19 +33,19 @@ export const AttachmentSchema = z.object({ | ||
| 33 | 33 | "blobId": z.string(), |
| 34 | 34 | "filename": z.string(), |
| 35 | 35 | "name": z.string(), |
| 36 | -}); | |
| 36 | +}).strict(); | |
| 37 | 37 | export type Attachment = z.infer<typeof AttachmentSchema>; |
| 38 | 38 | |
| 39 | 39 | export const CommonCoreSchema = z.object({ |
| 40 | 40 | "Contact Email": z.string(), |
| 41 | 41 | "Contact Name": z.string(), |
| 42 | 42 | "Publisher": z.string(), |
| 43 | -}); | |
| 43 | +}).strict(); | |
| 44 | 44 | export type CommonCore = z.infer<typeof CommonCoreSchema>; |
| 45 | 45 | |
| 46 | 46 | export const DatasetInformationSchema = z.object({ |
| 47 | 47 | "Agency": z.string(), |
| 48 | -}); | |
| 48 | +}).strict(); | |
| 49 | 49 | export type DatasetInformation = z.infer<typeof DatasetInformationSchema>; |
| 50 | 50 | |
| 51 | 51 | export const DatasetSummarySchema = z.object({ |
| @@ -55,35 +55,35 @@ export const DatasetSummarySchema = z.object({ | ||
| 55 | 55 | "Organization": z.string(), |
| 56 | 56 | "Posting Frequency": z.string(), |
| 57 | 57 | "Time Period": z.string(), |
| 58 | -}); | |
| 58 | +}).strict(); | |
| 59 | 59 | export type DatasetSummary = z.infer<typeof DatasetSummarySchema>; |
| 60 | 60 | |
| 61 | 61 | export const DisclaimersSchema = z.object({ |
| 62 | 62 | "Disclaimer": z.string(), |
| 63 | 63 | "Limitations": z.string(), |
| 64 | -}); | |
| 64 | +}).strict(); | |
| 65 | 65 | export type Disclaimers = z.infer<typeof DisclaimersSchema>; |
| 66 | 66 | |
| 67 | 67 | export const TableColumnIdSchema = z.object({ |
| 68 | 68 | "703610": z.number().int(), |
| 69 | -}); | |
| 69 | +}).strict(); | |
| 70 | 70 | export type TableColumnId = z.infer<typeof TableColumnIdSchema>; |
| 71 | 71 | |
| 72 | 72 | export const FilterConditionMetadataSchema = z.object({ |
| 73 | 73 | "advanced": z.boolean(), |
| 74 | 74 | "unifiedVersion": z.number().int(), |
| 75 | -}); | |
| 75 | +}).strict(); | |
| 76 | 76 | export type FilterConditionMetadata = z.infer<typeof FilterConditionMetadataSchema>; |
| 77 | 77 | |
| 78 | 78 | export const OrderSchema = z.object({ |
| 79 | 79 | "ascending": z.boolean(), |
| 80 | 80 | "columnFieldName": z.string(), |
| 81 | -}); | |
| 81 | +}).strict(); | |
| 82 | 82 | export type Order = z.infer<typeof OrderSchema>; |
| 83 | 83 | |
| 84 | 84 | export const VisibleSchema = z.object({ |
| 85 | 85 | "table": z.boolean(), |
| 86 | -}); | |
| 86 | +}).strict(); | |
| 87 | 87 | export type Visible = z.infer<typeof VisibleSchema>; |
| 88 | 88 | |
| 89 | 89 | export const OwnerSchema = z.object({ |
| @@ -95,13 +95,13 @@ export const OwnerSchema = z.object({ | ||
| 95 | 95 | "rights": z.array(z.string()), |
| 96 | 96 | "roleName": z.string(), |
| 97 | 97 | "screenName": z.string(), |
| 98 | -}); | |
| 98 | +}).strict(); | |
| 99 | 99 | export type Owner = z.infer<typeof OwnerSchema>; |
| 100 | 100 | |
| 101 | 101 | export const ExpressionSchema = z.object({ |
| 102 | 102 | "columnId": z.number().int(), |
| 103 | 103 | "type": z.string(), |
| 104 | -}); | |
| 104 | +}).strict(); | |
| 105 | 105 | export type Expression = z.infer<typeof ExpressionSchema>; |
| 106 | 106 | |
| 107 | 107 | export const CachedContentsSchema = z.object({ |
| @@ -112,7 +112,7 @@ export const CachedContentsSchema = z.object({ | ||
| 112 | 112 | "smallest": z.string(), |
| 113 | 113 | "sum": z.string().regex(/^-?\d+$/).optional(), |
| 114 | 114 | "top": z.array(TopSchema), |
| 115 | -}); | |
| 115 | +}).strict(); | |
| 116 | 116 | export type CachedContents = z.infer<typeof CachedContentsSchema>; |
| 117 | 117 | |
| 118 | 118 | export const CustomFieldsSchema = z.object({ |
| @@ -120,30 +120,30 @@ export const CustomFieldsSchema = z.object({ | ||
| 120 | 120 | "Dataset Information": DatasetInformationSchema, |
| 121 | 121 | "Dataset Summary": DatasetSummarySchema, |
| 122 | 122 | "Disclaimers": DisclaimersSchema, |
| 123 | -}); | |
| 123 | +}).strict(); | |
| 124 | 124 | export type CustomFields = z.infer<typeof CustomFieldsSchema>; |
| 125 | 125 | |
| 126 | 126 | export const ChildMetadataSchema = z.object({ |
| 127 | 127 | "customValues": z.array(z.array(z.string())), |
| 128 | 128 | "operator": z.string(), |
| 129 | 129 | "tableColumnId": TableColumnIdSchema, |
| 130 | -}); | |
| 130 | +}).strict(); | |
| 131 | 131 | export type ChildMetadata = z.infer<typeof ChildMetadataSchema>; |
| 132 | 132 | |
| 133 | 133 | export const JsonQuerySchema = z.object({ |
| 134 | 134 | "order": z.array(OrderSchema), |
| 135 | -}); | |
| 135 | +}).strict(); | |
| 136 | 136 | export type JsonQuery = z.infer<typeof JsonQuerySchema>; |
| 137 | 137 | |
| 138 | 138 | export const RenderTypeConfigSchema = z.object({ |
| 139 | 139 | "visible": VisibleSchema, |
| 140 | -}); | |
| 140 | +}).strict(); | |
| 141 | 141 | export type RenderTypeConfig = z.infer<typeof RenderTypeConfigSchema>; |
| 142 | 142 | |
| 143 | 143 | export const OrderBySchema = z.object({ |
| 144 | 144 | "ascending": z.boolean(), |
| 145 | 145 | "expression": ExpressionSchema, |
| 146 | -}); | |
| 146 | +}).strict(); | |
| 147 | 147 | export type OrderBy = z.infer<typeof OrderBySchema>; |
| 148 | 148 | |
| 149 | 149 | export const ColumnSchema = z.object({ |
| @@ -159,19 +159,19 @@ export const ColumnSchema = z.object({ | ||
| 159 | 159 | "renderTypeName": TypeNameSchema, |
| 160 | 160 | "tableColumnId": z.number().int().optional(), |
| 161 | 161 | "width": z.number().int().optional(), |
| 162 | -}); | |
| 162 | +}).strict(); | |
| 163 | 163 | export type Column = z.infer<typeof ColumnSchema>; |
| 164 | 164 | |
| 165 | 165 | export const ChildSchema = z.object({ |
| 166 | 166 | "metadata": ChildMetadataSchema, |
| 167 | 167 | "type": z.string(), |
| 168 | 168 | "value": z.string(), |
| 169 | -}); | |
| 169 | +}).strict(); | |
| 170 | 170 | export type Child = z.infer<typeof ChildSchema>; |
| 171 | 171 | |
| 172 | 172 | export const QuerySchema = z.object({ |
| 173 | 173 | "orderBys": z.array(OrderBySchema), |
| 174 | -}); | |
| 174 | +}).strict(); | |
| 175 | 175 | export type Query = z.infer<typeof QuerySchema>; |
| 176 | 176 | |
| 177 | 177 | export const FilterConditionSchema = z.object({ |
| @@ -179,7 +179,7 @@ export const FilterConditionSchema = z.object({ | ||
| 179 | 179 | "metadata": FilterConditionMetadataSchema, |
| 180 | 180 | "type": z.string(), |
| 181 | 181 | "value": z.string(), |
| 182 | -}); | |
| 182 | +}).strict(); | |
| 183 | 183 | export type FilterCondition = z.infer<typeof FilterConditionSchema>; |
| 184 | 184 | |
| 185 | 185 | export const ViewMetadataSchema = z.object({ |
| @@ -191,7 +191,7 @@ export const ViewMetadataSchema = z.object({ | ||
| 191 | 191 | "rdfSubject": z.string().regex(/^-?\d+$/), |
| 192 | 192 | "renderTypeConfig": RenderTypeConfigSchema, |
| 193 | 193 | "rowLabel": z.string(), |
| 194 | -}); | |
| 194 | +}).strict(); | |
| 195 | 195 | export type ViewMetadata = z.infer<typeof ViewMetadataSchema>; |
| 196 | 196 | |
| 197 | 197 | export const ViewSchema = z.object({ |
| @@ -232,16 +232,16 @@ export const ViewSchema = z.object({ | ||
| 232 | 232 | "viewCount": z.number().int(), |
| 233 | 233 | "viewLastModified": z.number().int(), |
| 234 | 234 | "viewType": z.string(), |
| 235 | -}); | |
| 235 | +}).strict(); | |
| 236 | 236 | export type View = z.infer<typeof ViewSchema>; |
| 237 | 237 | |
| 238 | 238 | export const MetaSchema = z.object({ |
| 239 | 239 | "view": ViewSchema, |
| 240 | -}); | |
| 240 | +}).strict(); | |
| 241 | 241 | export type Meta = z.infer<typeof MetaSchema>; |
| 242 | 242 | |
| 243 | 243 | export const TopLevelSchema = z.object({ |
| 244 | 244 | "data": z.array(z.array(z.union([z.null(), z.number().int(), z.string()]))), |
| 245 | 245 | "meta": MetaSchema, |
| 246 | -}); | |
| 246 | +}).strict(); | |
| 247 | 247 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +3 −3test/inputs/json/misc/fd329.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -4,7 +4,7 @@ import * as z from "zod"; | ||
| 4 | 4 | export const DatumSchema = z.object({ |
| 5 | 5 | "anomaly": z.string(), |
| 6 | 6 | "value": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Datum = z.infer<typeof DatumSchema>; |
| 9 | 9 | |
| 10 | 10 | export const DescriptionSchema = z.object({ |
| @@ -12,11 +12,11 @@ export const DescriptionSchema = z.object({ | ||
| 12 | 12 | "missing": z.number().int(), |
| 13 | 13 | "title": z.string(), |
| 14 | 14 | "units": z.string(), |
| 15 | -}); | |
| 15 | +}).strict(); | |
| 16 | 16 | export type Description = z.infer<typeof DescriptionSchema>; |
| 17 | 17 | |
| 18 | 18 | export const TopLevelSchema = z.object({ |
| 19 | 19 | "data": z.record(z.string(), DatumSchema), |
| 20 | 20 | "description": DescriptionSchema, |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/priority/blns-object.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -232,7 +232,7 @@ export const ASchema = z.object({ | ||
| 232 | 232 | "和製漢語": z.string(), |
| 233 | 233 | "田中さんにあげて下さい": z.string(), |
| 234 | 234 | "`ィ(´∀`∩": z.string(), |
| 235 | -}); | |
| 235 | +}).strict(); | |
| 236 | 236 | export type A = z.infer<typeof ASchema>; |
| 237 | 237 | |
| 238 | 238 | export const BSchema = z.object({ |
| @@ -395,7 +395,7 @@ export const BSchema = z.object({ | ||
| 395 | 395 | "찦차를 타고 온 펲시맨과 쑛다리 똠방각하": z.string(), |
| 396 | 396 | "ﷺ": z.string(), |
| 397 | 397 | "__ロ(,_,*)": z.string(), |
| 398 | -}); | |
| 398 | +}).strict(); | |
| 399 | 399 | export type B = z.infer<typeof BSchema>; |
| 400 | 400 | |
| 401 | 401 | export const CSchema = z.object({ |
| @@ -594,12 +594,12 @@ export const CSchema = z.object({ | ||
| 594 | 594 | "울란바토르": z.string(), |
| 595 | 595 | "The quick brown fox jumps over the lazy dog": z.string(), |
| 596 | 596 | "(ノಥ益ಥ)ノ\ufeff ┻━┻": z.string(), |
| 597 | -}); | |
| 597 | +}).strict(); | |
| 598 | 598 | export type C = z.infer<typeof CSchema>; |
| 599 | 599 | |
| 600 | 600 | export const TopLevelSchema = z.object({ |
| 601 | 601 | "a": ASchema, |
| 602 | 602 | "b": BSchema, |
| 603 | 603 | "c": CSchema, |
| 604 | -}); | |
| 604 | +}).strict(); | |
| 605 | 605 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/json/priority/bug2037.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -2,20 +2,20 @@ import * as z from "zod"; | ||
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | export const RewardSchema = z.object({ |
| 5 | -}); | |
| 5 | +}).strict(); | |
| 6 | 6 | export type Reward = z.infer<typeof RewardSchema>; |
| 7 | 7 | |
| 8 | 8 | export const ObjectiveSchema = z.object({ |
| 9 | 9 | "rewards": z.record(z.string(), RewardSchema), |
| 10 | -}); | |
| 10 | +}).strict(); | |
| 11 | 11 | export type Objective = z.infer<typeof ObjectiveSchema>; |
| 12 | 12 | |
| 13 | 13 | export const MissionSpecSchema = z.object({ |
| 14 | 14 | "objectives": z.record(z.string(), ObjectiveSchema), |
| 15 | -}); | |
| 15 | +}).strict(); | |
| 16 | 16 | export type MissionSpec = z.infer<typeof MissionSpecSchema>; |
| 17 | 17 | |
| 18 | 18 | export const TopLevelSchema = z.object({ |
| 19 | 19 | "mission_specs": z.record(z.string(), MissionSpecSchema), |
| 20 | -}); | |
| 20 | +}).strict(); | |
| 21 | 21 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/json/priority/bug2521.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -4,10 +4,10 @@ import * as z from "zod"; | ||
| 4 | 4 | export const OptionSchema = z.object({ |
| 5 | 5 | "foo": z.string().optional(), |
| 6 | 6 | "name": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Option = z.infer<typeof OptionSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "options": z.array(OptionSchema), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/json/priority/bug2590.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -5,10 +5,10 @@ export const InvoiceSchema = z.object({ | ||
| 5 | 5 | "createdAt": z.union([z.null(), z.coerce.date()]), |
| 6 | 6 | "dueDate": z.union([z.null(), z.string()]), |
| 7 | 7 | "name": z.string(), |
| 8 | -}); | |
| 8 | +}).strict(); | |
| 9 | 9 | export type Invoice = z.infer<typeof InvoiceSchema>; |
| 10 | 10 | |
| 11 | 11 | export const TopLevelSchema = z.object({ |
| 12 | 12 | "invoices": z.array(InvoiceSchema), |
| 13 | -}); | |
| 13 | +}).strict(); | |
| 14 | 14 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/priority/bug2663.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -5,5 +5,5 @@ export const TopLevelSchema = z.object({ | ||
| 5 | 5 | "birthday": z.string(), |
| 6 | 6 | "lastSeen": z.coerce.date(), |
| 7 | 7 | "name": z.string(), |
| 8 | -}); | |
| 8 | +}).strict(); | |
| 9 | 9 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +3 −3test/inputs/json/priority/bug2793.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -2,17 +2,17 @@ import * as z from "zod"; | ||
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | export const HintsSchema = z.object({ |
| 5 | -}); | |
| 5 | +}).strict(); | |
| 6 | 6 | export type Hints = z.infer<typeof HintsSchema>; |
| 7 | 7 | |
| 8 | 8 | export const LabelsSchema = z.object({ |
| 9 | 9 | "AccountNumber": z.string(), |
| 10 | 10 | "Title": z.string(), |
| 11 | -}); | |
| 11 | +}).strict(); | |
| 12 | 12 | export type Labels = z.infer<typeof LabelsSchema>; |
| 13 | 13 | |
| 14 | 14 | export const TopLevelSchema = z.object({ |
| 15 | 15 | "Hints": HintsSchema, |
| 16 | 16 | "Labels": LabelsSchema, |
| 17 | -}); | |
| 17 | +}).strict(); | |
| 18 | 18 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +61 −61test/inputs/json/priority/bug427.json
Mtypescript-zoddefault / TopLevel.ts+61 −61
| @@ -103,7 +103,7 @@ export const GetSignatureTypeSchema: z.ZodType<GetSignatureType> = z.lazy(() => | ||
| 103 | 103 | "elementType": ElementTypeSchema.optional(), |
| 104 | 104 | "name": NameSchema.optional(), |
| 105 | 105 | "type": TypeEnumSchema, |
| 106 | - }) | |
| 106 | + }).strict() | |
| 107 | 107 | ); |
| 108 | 108 | |
| 109 | 109 | export type IndexSignatureElement = { |
| @@ -124,7 +124,7 @@ export const IndexSignatureElementSchema: z.ZodType<IndexSignatureElement> = z.l | ||
| 124 | 124 | "name": z.string(), |
| 125 | 125 | "parameters": z.array(GetSignatureSchema).optional(), |
| 126 | 126 | "type": PurpleTypeSchema, |
| 127 | - }) | |
| 127 | + }).strict() | |
| 128 | 128 | ); |
| 129 | 129 | |
| 130 | 130 | export type PurpleType = { |
| @@ -137,7 +137,7 @@ export const PurpleTypeSchema: z.ZodType<PurpleType> = z.lazy(() => | ||
| 137 | 137 | "declaration": GetSignatureSchema.optional(), |
| 138 | 138 | "name": NameSchema.optional(), |
| 139 | 139 | "type": TypeEnumSchema, |
| 140 | - }) | |
| 140 | + }).strict() | |
| 141 | 141 | ); |
| 142 | 142 | |
| 143 | 143 | export type GetSignatureChild = { |
| @@ -160,7 +160,7 @@ export const GetSignatureChildSchema: z.ZodType<GetSignatureChild> = z.lazy(() = | ||
| 160 | 160 | "name": z.string(), |
| 161 | 161 | "sources": z.array(SourceSchema), |
| 162 | 162 | "type": PurpleTypeSchema, |
| 163 | - }) | |
| 163 | + }).strict() | |
| 164 | 164 | ); |
| 165 | 165 | |
| 166 | 166 | export type GetSignature = { |
| @@ -195,7 +195,7 @@ export const GetSignatureSchema: z.ZodType<GetSignature> = z.lazy(() => | ||
| 195 | 195 | "sources": z.array(SourceSchema).optional(), |
| 196 | 196 | "type": GetSignatureTypeSchema.optional(), |
| 197 | 197 | "typeParameter": z.array(GetSignatureSchema).optional(), |
| 198 | - }) | |
| 198 | + }).strict() | |
| 199 | 199 | ); |
| 200 | 200 | |
| 201 | 201 | export type ExtendedBy = { |
| @@ -212,70 +212,70 @@ export const ExtendedBySchema: z.ZodType<ExtendedBy> = z.lazy(() => | ||
| 212 | 212 | "name": z.string(), |
| 213 | 213 | "type": TypeEnumSchema, |
| 214 | 214 | "typeArguments": z.array(ExtendedBySchema).optional(), |
| 215 | - }) | |
| 215 | + }).strict() | |
| 216 | 216 | ); |
| 217 | 217 | |
| 218 | 218 | export const PurpleCommentSchema = z.object({ |
| 219 | 219 | "shortText": z.string(), |
| 220 | -}); | |
| 220 | +}).strict(); | |
| 221 | 221 | export type PurpleComment = z.infer<typeof PurpleCommentSchema>; |
| 222 | 222 | |
| 223 | 223 | export const PurpleFlagsSchema = z.object({ |
| 224 | 224 | "isExported": z.boolean().optional(), |
| 225 | -}); | |
| 225 | +}).strict(); | |
| 226 | 226 | export type PurpleFlags = z.infer<typeof PurpleFlagsSchema>; |
| 227 | 227 | |
| 228 | 228 | export const GetSignatureFlagsSchema = z.object({ |
| 229 | -}); | |
| 229 | +}).strict(); | |
| 230 | 230 | export type GetSignatureFlags = z.infer<typeof GetSignatureFlagsSchema>; |
| 231 | 231 | |
| 232 | 232 | export const ElementTypeSchema = z.object({ |
| 233 | 233 | "name": NameSchema, |
| 234 | 234 | "type": TypeEnumSchema, |
| 235 | -}); | |
| 235 | +}).strict(); | |
| 236 | 236 | export type ElementType = z.infer<typeof ElementTypeSchema>; |
| 237 | 237 | |
| 238 | 238 | export const FluffyCommentSchema = z.object({ |
| 239 | 239 | "text": z.string(), |
| 240 | -}); | |
| 240 | +}).strict(); | |
| 241 | 241 | export type FluffyComment = z.infer<typeof FluffyCommentSchema>; |
| 242 | 242 | |
| 243 | 243 | export const FluffyFlagsSchema = z.object({ |
| 244 | 244 | "isOptional": z.boolean().optional(), |
| 245 | -}); | |
| 245 | +}).strict(); | |
| 246 | 246 | export type FluffyFlags = z.infer<typeof FluffyFlagsSchema>; |
| 247 | 247 | |
| 248 | 248 | export const SourceSchema = z.object({ |
| 249 | 249 | "character": z.number().int(), |
| 250 | 250 | "fileName": FileNameSchema, |
| 251 | 251 | "line": z.number().int(), |
| 252 | -}); | |
| 252 | +}).strict(); | |
| 253 | 253 | export type Source = z.infer<typeof SourceSchema>; |
| 254 | 254 | |
| 255 | 255 | export const GetSignatureCommentSchema = z.object({ |
| 256 | 256 | "returns": z.string().optional(), |
| 257 | 257 | "shortText": z.string().optional(), |
| 258 | 258 | "text": z.string().optional(), |
| 259 | -}); | |
| 259 | +}).strict(); | |
| 260 | 260 | export type GetSignatureComment = z.infer<typeof GetSignatureCommentSchema>; |
| 261 | 261 | |
| 262 | 262 | export const GroupSchema = z.object({ |
| 263 | 263 | "children": z.array(z.number().int()), |
| 264 | 264 | "kind": z.number().int(), |
| 265 | 265 | "title": z.string(), |
| 266 | -}); | |
| 266 | +}).strict(); | |
| 267 | 267 | export type Group = z.infer<typeof GroupSchema>; |
| 268 | 268 | |
| 269 | 269 | export const TentacledCommentSchema = z.object({ |
| 270 | 270 | "shortText": z.string().optional(), |
| 271 | 271 | "text": z.string().optional(), |
| 272 | -}); | |
| 272 | +}).strict(); | |
| 273 | 273 | export type TentacledComment = z.infer<typeof TentacledCommentSchema>; |
| 274 | 274 | |
| 275 | 275 | export const TentacledFlagsSchema = z.object({ |
| 276 | 276 | "isOptional": z.boolean().optional(), |
| 277 | 277 | "isRest": z.boolean().optional(), |
| 278 | -}); | |
| 278 | +}).strict(); | |
| 279 | 279 | export type TentacledFlags = z.infer<typeof TentacledFlagsSchema>; |
| 280 | 280 | |
| 281 | 281 | export const FluffyTypeSchema = z.object({ |
| @@ -283,7 +283,7 @@ export const FluffyTypeSchema = z.object({ | ||
| 283 | 283 | "name": NameSchema.optional(), |
| 284 | 284 | "type": TypeEnumSchema, |
| 285 | 285 | "typeArguments": z.array(ElementTypeSchema).optional(), |
| 286 | -}); | |
| 286 | +}).strict(); | |
| 287 | 287 | export type FluffyType = z.infer<typeof FluffyTypeSchema>; |
| 288 | 288 | |
| 289 | 289 | export const PurpleDeclarationSchema = z.object({ |
| @@ -294,7 +294,7 @@ export const PurpleDeclarationSchema = z.object({ | ||
| 294 | 294 | "kind": z.number().int(), |
| 295 | 295 | "kindString": z.string(), |
| 296 | 296 | "name": z.string(), |
| 297 | -}); | |
| 297 | +}).strict(); | |
| 298 | 298 | export type PurpleDeclaration = z.infer<typeof PurpleDeclarationSchema>; |
| 299 | 299 | |
| 300 | 300 | export const TypeElementSchema = z.object({ |
| @@ -303,13 +303,13 @@ export const TypeElementSchema = z.object({ | ||
| 303 | 303 | "name": NameSchema.optional(), |
| 304 | 304 | "type": TypeEnumSchema, |
| 305 | 305 | "typeArguments": z.array(ElementTypeSchema).optional(), |
| 306 | -}); | |
| 306 | +}).strict(); | |
| 307 | 307 | export type TypeElement = z.infer<typeof TypeElementSchema>; |
| 308 | 308 | |
| 309 | 309 | export const TagSchema = z.object({ |
| 310 | 310 | "tag": z.string(), |
| 311 | 311 | "text": z.string(), |
| 312 | -}); | |
| 312 | +}).strict(); | |
| 313 | 313 | export type Tag = z.infer<typeof TagSchema>; |
| 314 | 314 | |
| 315 | 315 | export const StickyFlagsSchema = z.object({ |
| @@ -320,13 +320,13 @@ export const StickyFlagsSchema = z.object({ | ||
| 320 | 320 | "isProtected": z.boolean().optional(), |
| 321 | 321 | "isPublic": z.boolean().optional(), |
| 322 | 322 | "isStatic": z.boolean().optional(), |
| 323 | -}); | |
| 323 | +}).strict(); | |
| 324 | 324 | export type StickyFlags = z.infer<typeof StickyFlagsSchema>; |
| 325 | 325 | |
| 326 | 326 | export const IndigoFlagsSchema = z.object({ |
| 327 | 327 | "isPrivate": z.boolean().optional(), |
| 328 | 328 | "isProtected": z.boolean().optional(), |
| 329 | -}); | |
| 329 | +}).strict(); | |
| 330 | 330 | export type IndigoFlags = z.infer<typeof IndigoFlagsSchema>; |
| 331 | 331 | |
| 332 | 332 | export const StickyTypeSchema = z.object({ |
| @@ -338,7 +338,7 @@ export const StickyTypeSchema = z.object({ | ||
| 338 | 338 | "name": z.string().optional(), |
| 339 | 339 | "type": TypeEnumSchema, |
| 340 | 340 | "typeArguments": z.array(ElementTypeSchema).optional(), |
| 341 | -}); | |
| 341 | +}).strict(); | |
| 342 | 342 | export type StickyType = z.infer<typeof StickyTypeSchema>; |
| 343 | 343 | |
| 344 | 344 | export const IndecentTypeSchema = z.object({ |
| @@ -346,19 +346,19 @@ export const IndecentTypeSchema = z.object({ | ||
| 346 | 346 | "elements": z.array(ElementTypeSchema).optional(), |
| 347 | 347 | "name": NameSchema.optional(), |
| 348 | 348 | "type": TypeEnumSchema, |
| 349 | -}); | |
| 349 | +}).strict(); | |
| 350 | 350 | export type IndecentType = z.infer<typeof IndecentTypeSchema>; |
| 351 | 351 | |
| 352 | 352 | export const HilariousTypeSchema = z.object({ |
| 353 | 353 | "declaration": GetSignatureSchema, |
| 354 | 354 | "type": TypeEnumSchema, |
| 355 | -}); | |
| 355 | +}).strict(); | |
| 356 | 356 | export type HilariousType = z.infer<typeof HilariousTypeSchema>; |
| 357 | 357 | |
| 358 | 358 | export const IndigoCommentSchema = z.object({ |
| 359 | 359 | "returns": z.string(), |
| 360 | 360 | "shortText": z.string(), |
| 361 | -}); | |
| 361 | +}).strict(); | |
| 362 | 362 | export type IndigoComment = z.infer<typeof IndigoCommentSchema>; |
| 363 | 363 | |
| 364 | 364 | export const FluffyParameterSchema = z.object({ |
| @@ -370,14 +370,14 @@ export const FluffyParameterSchema = z.object({ | ||
| 370 | 370 | "name": z.string(), |
| 371 | 371 | "sources": z.array(SourceSchema).optional(), |
| 372 | 372 | "type": ElementTypeSchema, |
| 373 | -}); | |
| 373 | +}).strict(); | |
| 374 | 374 | export type FluffyParameter = z.infer<typeof FluffyParameterSchema>; |
| 375 | 375 | |
| 376 | 376 | export const PurpleTypeArgumentSchema = z.object({ |
| 377 | 377 | "operator": z.string(), |
| 378 | 378 | "target": ElementTypeSchema, |
| 379 | 379 | "type": z.string(), |
| 380 | -}); | |
| 380 | +}).strict(); | |
| 381 | 381 | export type PurpleTypeArgument = z.infer<typeof PurpleTypeArgumentSchema>; |
| 382 | 382 | |
| 383 | 383 | export const IndecentFlagsSchema = z.object({ |
| @@ -388,7 +388,7 @@ export const IndecentFlagsSchema = z.object({ | ||
| 388 | 388 | "isLet": z.boolean().optional(), |
| 389 | 389 | "isPrivate": z.boolean().optional(), |
| 390 | 390 | "isProtected": z.boolean().optional(), |
| 391 | -}); | |
| 391 | +}).strict(); | |
| 392 | 392 | export type IndecentFlags = z.infer<typeof IndecentFlagsSchema>; |
| 393 | 393 | |
| 394 | 394 | export const IndigoChildSchema = z.object({ |
| @@ -401,7 +401,7 @@ export const IndigoChildSchema = z.object({ | ||
| 401 | 401 | "name": z.string(), |
| 402 | 402 | "sources": z.array(SourceSchema), |
| 403 | 403 | "type": IndecentTypeSchema, |
| 404 | -}); | |
| 404 | +}).strict(); | |
| 405 | 405 | export type IndigoChild = z.infer<typeof IndigoChildSchema>; |
| 406 | 406 | |
| 407 | 407 | export const CunningTypeSchema = z.object({ |
| @@ -410,7 +410,7 @@ export const CunningTypeSchema = z.object({ | ||
| 410 | 410 | "name": NameSchema.optional(), |
| 411 | 411 | "type": TypeEnumSchema, |
| 412 | 412 | "typeArguments": z.array(ElementTypeSchema).optional(), |
| 413 | -}); | |
| 413 | +}).strict(); | |
| 414 | 414 | export type CunningType = z.infer<typeof CunningTypeSchema>; |
| 415 | 415 | |
| 416 | 416 | export const IndigoDeclarationSchema = z.object({ |
| @@ -423,13 +423,13 @@ export const IndigoDeclarationSchema = z.object({ | ||
| 423 | 423 | "name": z.string(), |
| 424 | 424 | "signatures": z.array(GetSignatureSchema).optional(), |
| 425 | 425 | "sources": z.array(SourceSchema), |
| 426 | -}); | |
| 426 | +}).strict(); | |
| 427 | 427 | export type IndigoDeclaration = z.infer<typeof IndigoDeclarationSchema>; |
| 428 | 428 | |
| 429 | 429 | export const FluffyTypeArgumentSchema = z.object({ |
| 430 | 430 | "type": TypeEnumSchema, |
| 431 | 431 | "types": z.array(ElementTypeSchema), |
| 432 | -}); | |
| 432 | +}).strict(); | |
| 433 | 433 | export type FluffyTypeArgument = z.infer<typeof FluffyTypeArgumentSchema>; |
| 434 | 434 | |
| 435 | 435 | export const MischievousTypeSchema = z.object({ |
| @@ -438,13 +438,13 @@ export const MischievousTypeSchema = z.object({ | ||
| 438 | 438 | "operator": z.string().optional(), |
| 439 | 439 | "target": ElementTypeSchema.optional(), |
| 440 | 440 | "type": z.string(), |
| 441 | -}); | |
| 441 | +}).strict(); | |
| 442 | 442 | export type MischievousType = z.infer<typeof MischievousTypeSchema>; |
| 443 | 443 | |
| 444 | 444 | export const IndecentCommentSchema = z.object({ |
| 445 | 445 | "shortText": z.string(), |
| 446 | 446 | "tags": z.array(TagSchema).optional(), |
| 447 | -}); | |
| 447 | +}).strict(); | |
| 448 | 448 | export type IndecentComment = z.infer<typeof IndecentCommentSchema>; |
| 449 | 449 | |
| 450 | 450 | export const GetSignatureParameterSchema = z.object({ |
| @@ -455,14 +455,14 @@ export const GetSignatureParameterSchema = z.object({ | ||
| 455 | 455 | "kindString": ParameterKindStringSchema, |
| 456 | 456 | "name": z.string(), |
| 457 | 457 | "type": FluffyTypeSchema, |
| 458 | -}); | |
| 458 | +}).strict(); | |
| 459 | 459 | export type GetSignatureParameter = z.infer<typeof GetSignatureParameterSchema>; |
| 460 | 460 | |
| 461 | 461 | export const TentacledTypeSchema = z.object({ |
| 462 | 462 | "declaration": PurpleDeclarationSchema.optional(), |
| 463 | 463 | "name": NameSchema.optional(), |
| 464 | 464 | "type": TypeEnumSchema, |
| 465 | -}); | |
| 465 | +}).strict(); | |
| 466 | 466 | export type TentacledType = z.infer<typeof TentacledTypeSchema>; |
| 467 | 467 | |
| 468 | 468 | export const StickyCommentSchema = z.object({ |
| @@ -470,7 +470,7 @@ export const StickyCommentSchema = z.object({ | ||
| 470 | 470 | "shortText": z.string().optional(), |
| 471 | 471 | "tags": z.array(TagSchema).optional(), |
| 472 | 472 | "text": z.string().optional(), |
| 473 | -}); | |
| 473 | +}).strict(); | |
| 474 | 474 | export type StickyComment = z.infer<typeof StickyCommentSchema>; |
| 475 | 475 | |
| 476 | 476 | export const PurpleParameterSchema = z.object({ |
| @@ -481,7 +481,7 @@ export const PurpleParameterSchema = z.object({ | ||
| 481 | 481 | "kindString": ParameterKindStringSchema, |
| 482 | 482 | "name": z.string(), |
| 483 | 483 | "type": StickyTypeSchema, |
| 484 | -}); | |
| 484 | +}).strict(); | |
| 485 | 485 | export type PurpleParameter = z.infer<typeof PurpleParameterSchema>; |
| 486 | 486 | |
| 487 | 487 | export const StickyChildSchema = z.object({ |
| @@ -493,7 +493,7 @@ export const StickyChildSchema = z.object({ | ||
| 493 | 493 | "name": z.string(), |
| 494 | 494 | "sources": z.array(SourceSchema), |
| 495 | 495 | "type": IndecentTypeSchema, |
| 496 | -}); | |
| 496 | +}).strict(); | |
| 497 | 497 | export type StickyChild = z.infer<typeof StickyChildSchema>; |
| 498 | 498 | |
| 499 | 499 | export const IndexSignatureSchema = z.object({ |
| @@ -504,7 +504,7 @@ export const IndexSignatureSchema = z.object({ | ||
| 504 | 504 | "name": z.string(), |
| 505 | 505 | "parameters": z.array(GetSignatureSchema), |
| 506 | 506 | "type": HilariousTypeSchema, |
| 507 | -}); | |
| 507 | +}).strict(); | |
| 508 | 508 | export type IndexSignature = z.infer<typeof IndexSignatureSchema>; |
| 509 | 509 | |
| 510 | 510 | export const TentacledSignatureSchema = z.object({ |
| @@ -516,7 +516,7 @@ export const TentacledSignatureSchema = z.object({ | ||
| 516 | 516 | "name": z.string(), |
| 517 | 517 | "parameters": z.array(FluffyParameterSchema).optional(), |
| 518 | 518 | "type": ExtendedBySchema, |
| 519 | -}); | |
| 519 | +}).strict(); | |
| 520 | 520 | export type TentacledSignature = z.infer<typeof TentacledSignatureSchema>; |
| 521 | 521 | |
| 522 | 522 | export const TentacledDeclarationSchema = z.object({ |
| @@ -530,14 +530,14 @@ export const TentacledDeclarationSchema = z.object({ | ||
| 530 | 530 | "name": z.string(), |
| 531 | 531 | "signatures": z.array(GetSignatureSchema).optional(), |
| 532 | 532 | "sources": z.array(SourceSchema), |
| 533 | -}); | |
| 533 | +}).strict(); | |
| 534 | 534 | export type TentacledDeclaration = z.infer<typeof TentacledDeclarationSchema>; |
| 535 | 535 | |
| 536 | 536 | export const FriskyTypeSchema = z.object({ |
| 537 | 537 | "declaration": IndigoDeclarationSchema.optional(), |
| 538 | 538 | "name": NameSchema.optional(), |
| 539 | 539 | "type": TypeEnumSchema, |
| 540 | -}); | |
| 540 | +}).strict(); | |
| 541 | 541 | export type FriskyType = z.infer<typeof FriskyTypeSchema>; |
| 542 | 542 | |
| 543 | 543 | export const TypeParameterSchema = z.object({ |
| @@ -548,7 +548,7 @@ export const TypeParameterSchema = z.object({ | ||
| 548 | 548 | "kindString": z.string(), |
| 549 | 549 | "name": z.string(), |
| 550 | 550 | "type": MischievousTypeSchema.optional(), |
| 551 | -}); | |
| 551 | +}).strict(); | |
| 552 | 552 | export type TypeParameter = z.infer<typeof TypeParameterSchema>; |
| 553 | 553 | |
| 554 | 554 | export const PurpleSignatureSchema = z.object({ |
| @@ -560,7 +560,7 @@ export const PurpleSignatureSchema = z.object({ | ||
| 560 | 560 | "name": z.string(), |
| 561 | 561 | "parameters": z.array(GetSignatureSchema), |
| 562 | 562 | "type": TentacledTypeSchema, |
| 563 | -}); | |
| 563 | +}).strict(); | |
| 564 | 564 | export type PurpleSignature = z.infer<typeof PurpleSignatureSchema>; |
| 565 | 565 | |
| 566 | 566 | export const FluffySignatureSchema = z.object({ |
| @@ -576,7 +576,7 @@ export const FluffySignatureSchema = z.object({ | ||
| 576 | 576 | "parameters": z.array(PurpleParameterSchema).optional(), |
| 577 | 577 | "type": ExtendedBySchema, |
| 578 | 578 | "typeParameter": z.array(GetSignatureSchema).optional(), |
| 579 | -}); | |
| 579 | +}).strict(); | |
| 580 | 580 | export type FluffySignature = z.infer<typeof FluffySignatureSchema>; |
| 581 | 581 | |
| 582 | 582 | export const FluffyDeclarationSchema = z.object({ |
| @@ -590,7 +590,7 @@ export const FluffyDeclarationSchema = z.object({ | ||
| 590 | 590 | "name": z.string(), |
| 591 | 591 | "signatures": z.array(TentacledSignatureSchema).optional(), |
| 592 | 592 | "sources": z.array(SourceSchema), |
| 593 | -}); | |
| 593 | +}).strict(); | |
| 594 | 594 | export type FluffyDeclaration = z.infer<typeof FluffyDeclarationSchema>; |
| 595 | 595 | |
| 596 | 596 | export const AmbitiousTypeSchema = z.object({ |
| @@ -600,7 +600,7 @@ export const AmbitiousTypeSchema = z.object({ | ||
| 600 | 600 | "name": z.string().optional(), |
| 601 | 601 | "type": TypeEnumSchema, |
| 602 | 602 | "typeArguments": z.array(ElementTypeSchema).optional(), |
| 603 | -}); | |
| 603 | +}).strict(); | |
| 604 | 604 | export type AmbitiousType = z.infer<typeof AmbitiousTypeSchema>; |
| 605 | 605 | |
| 606 | 606 | export const IndecentChildSchema = z.object({ |
| @@ -611,7 +611,7 @@ export const IndecentChildSchema = z.object({ | ||
| 611 | 611 | "name": z.string(), |
| 612 | 612 | "sources": z.array(SourceSchema), |
| 613 | 613 | "type": FriskyTypeSchema, |
| 614 | -}); | |
| 614 | +}).strict(); | |
| 615 | 615 | export type IndecentChild = z.infer<typeof IndecentChildSchema>; |
| 616 | 616 | |
| 617 | 617 | export const TentacledChildSchema = z.object({ |
| @@ -625,7 +625,7 @@ export const TentacledChildSchema = z.object({ | ||
| 625 | 625 | "signatures": z.array(PurpleSignatureSchema).optional(), |
| 626 | 626 | "sources": z.array(SourceSchema), |
| 627 | 627 | "type": TypeElementSchema.optional(), |
| 628 | -}); | |
| 628 | +}).strict(); | |
| 629 | 629 | export type TentacledChild = z.infer<typeof TentacledChildSchema>; |
| 630 | 630 | |
| 631 | 631 | export const IndigoTypeSchema = z.object({ |
| @@ -638,7 +638,7 @@ export const IndigoTypeSchema = z.object({ | ||
| 638 | 638 | "type": TypeEnumSchema, |
| 639 | 639 | "typeArguments": z.array(PurpleTypeArgumentSchema).optional(), |
| 640 | 640 | "types": z.array(TypeElementSchema).optional(), |
| 641 | -}); | |
| 641 | +}).strict(); | |
| 642 | 642 | export type IndigoType = z.infer<typeof IndigoTypeSchema>; |
| 643 | 643 | |
| 644 | 644 | export const TentacledParameterSchema = z.object({ |
| @@ -651,7 +651,7 @@ export const TentacledParameterSchema = z.object({ | ||
| 651 | 651 | "name": z.string(), |
| 652 | 652 | "originalName": z.string().optional(), |
| 653 | 653 | "type": AmbitiousTypeSchema, |
| 654 | -}); | |
| 654 | +}).strict(); | |
| 655 | 655 | export type TentacledParameter = z.infer<typeof TentacledParameterSchema>; |
| 656 | 656 | |
| 657 | 657 | export const StickyDeclarationSchema = z.object({ |
| @@ -664,7 +664,7 @@ export const StickyDeclarationSchema = z.object({ | ||
| 664 | 664 | "name": z.string(), |
| 665 | 665 | "signatures": z.array(GetSignatureSchema), |
| 666 | 666 | "sources": z.array(SourceSchema), |
| 667 | -}); | |
| 667 | +}).strict(); | |
| 668 | 668 | export type StickyDeclaration = z.infer<typeof StickyDeclarationSchema>; |
| 669 | 669 | |
| 670 | 670 | export const FluffyChildSchema = z.object({ |
| @@ -685,7 +685,7 @@ export const FluffyChildSchema = z.object({ | ||
| 685 | 685 | "signatures": z.array(FluffySignatureSchema).optional(), |
| 686 | 686 | "sources": z.array(SourceSchema), |
| 687 | 687 | "type": IndigoTypeSchema.optional(), |
| 688 | -}); | |
| 688 | +}).strict(); | |
| 689 | 689 | export type FluffyChild = z.infer<typeof FluffyChildSchema>; |
| 690 | 690 | |
| 691 | 691 | export const StickySignatureSchema = z.object({ |
| @@ -698,7 +698,7 @@ export const StickySignatureSchema = z.object({ | ||
| 698 | 698 | "parameters": z.array(TentacledParameterSchema).optional(), |
| 699 | 699 | "type": CunningTypeSchema, |
| 700 | 700 | "typeParameter": z.array(GetSignatureSchema).optional(), |
| 701 | -}); | |
| 701 | +}).strict(); | |
| 702 | 702 | export type StickySignature = z.infer<typeof StickySignatureSchema>; |
| 703 | 703 | |
| 704 | 704 | export const MagentaTypeSchema = z.object({ |
| @@ -711,7 +711,7 @@ export const MagentaTypeSchema = z.object({ | ||
| 711 | 711 | "typeArguments": z.array(FluffyTypeArgumentSchema).optional(), |
| 712 | 712 | "types": z.array(ExtendedBySchema).optional(), |
| 713 | 713 | "value": z.string().optional(), |
| 714 | -}); | |
| 714 | +}).strict(); | |
| 715 | 715 | export type MagentaType = z.infer<typeof MagentaTypeSchema>; |
| 716 | 716 | |
| 717 | 717 | export const PurpleChildSchema = z.object({ |
| @@ -732,7 +732,7 @@ export const PurpleChildSchema = z.object({ | ||
| 732 | 732 | "sources": z.array(SourceSchema), |
| 733 | 733 | "type": MagentaTypeSchema.optional(), |
| 734 | 734 | "typeParameter": z.array(TypeParameterSchema).optional(), |
| 735 | -}); | |
| 735 | +}).strict(); | |
| 736 | 736 | export type PurpleChild = z.infer<typeof PurpleChildSchema>; |
| 737 | 737 | |
| 738 | 738 | export const TopLevelChildSchema = z.object({ |
| @@ -746,7 +746,7 @@ export const TopLevelChildSchema = z.object({ | ||
| 746 | 746 | "name": z.string(), |
| 747 | 747 | "originalName": z.string(), |
| 748 | 748 | "sources": z.array(SourceSchema), |
| 749 | -}); | |
| 749 | +}).strict(); | |
| 750 | 750 | export type TopLevelChild = z.infer<typeof TopLevelChildSchema>; |
| 751 | 751 | |
| 752 | 752 | export const TopLevelSchema = z.object({ |
| @@ -756,5 +756,5 @@ export const TopLevelSchema = z.object({ | ||
| 756 | 756 | "id": z.number().int(), |
| 757 | 757 | "kind": z.number().int(), |
| 758 | 758 | "name": z.string(), |
| 759 | -}); | |
| 759 | +}).strict(); | |
| 760 | 760 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/priority/bug790.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -21,5 +21,5 @@ export const TopLevelSchema: z.ZodType<TopLevel> = z.lazy(() => | ||
| 21 | 21 | "parent_id": z.number().int(), |
| 22 | 22 | "position": z.number().int(), |
| 23 | 23 | "product_count": z.number().int(), |
| 24 | - }) | |
| 24 | + }).strict() | |
| 25 | 25 | ); |
Test case
1 generated file · +1 −1test/inputs/json/priority/bug855-short.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -7,7 +7,7 @@ export const TopLevelValueSchema = z.object({ | ||
| 7 | 7 | "code": z.string(), |
| 8 | 8 | "emoticon_set": z.number().int(), |
| 9 | 9 | "id": z.number().int(), |
| 10 | -}); | |
| 10 | +}).strict(); | |
| 11 | 11 | export type TopLevelValue = z.infer<typeof TopLevelValueSchema>; |
| 12 | 12 | |
| 13 | 13 | export const TopLevelSchema = z.record(z.string(), TopLevelValueSchema); |
Test case
1 generated file · +2 −2test/inputs/json/priority/bug863.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -64,7 +64,7 @@ export const PurpleTopLevelSchema = z.object({ | ||
| 64 | 64 | "RANK": z.number().int(), |
| 65 | 65 | "RANK_TITLE": RankTitleSchema, |
| 66 | 66 | "SEX": SexSchema, |
| 67 | -}); | |
| 67 | +}).strict(); | |
| 68 | 68 | export type PurpleTopLevel = z.infer<typeof PurpleTopLevelSchema>; |
| 69 | 69 | |
| 70 | 70 | export const FluffyTopLevelSchema = z.object({ |
| @@ -103,7 +103,7 @@ export const FluffyTopLevelSchema = z.object({ | ||
| 103 | 103 | "SOLIDERCOUNT": z.number().int(), |
| 104 | 104 | "SOLITUSCOUNT": z.number().int(), |
| 105 | 105 | "TRADERCOUNT": z.number().int(), |
| 106 | -}); | |
| 106 | +}).strict(); | |
| 107 | 107 | export type FluffyTopLevel = z.infer<typeof FluffyTopLevelSchema>; |
| 108 | 108 | |
| 109 | 109 | export const TopLevelSchema = z.array(z.union([z.array(PurpleTopLevelSchema), FluffyTopLevelSchema, z.string()])); |
Test case
1 generated file · +2 −2test/inputs/json/priority/coin-pairs.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -10,11 +10,11 @@ export const PairSchema = z.object({ | ||
| 10 | 10 | "min_amount": z.number(), |
| 11 | 11 | "min_price": z.number(), |
| 12 | 12 | "min_total": z.number(), |
| 13 | -}); | |
| 13 | +}).strict(); | |
| 14 | 14 | export type Pair = z.infer<typeof PairSchema>; |
| 15 | 15 | |
| 16 | 16 | export const TopLevelSchema = z.object({ |
| 17 | 17 | "pairs": z.record(z.string(), PairSchema), |
| 18 | 18 | "server_time": z.number().int(), |
| 19 | -}); | |
| 19 | +}).strict(); | |
| 20 | 20 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +14 −14test/inputs/json/priority/combinations1.json
Mtypescript-zoddefault / TopLevel.ts+14 −14
| @@ -22,7 +22,7 @@ export const CerographClassSchema = z.object({ | ||
| 22 | 22 | "Tolowa": z.null(), |
| 23 | 23 | "tradeful": z.null(), |
| 24 | 24 | "unriveting": z.null(), |
| 25 | -}); | |
| 25 | +}).strict(); | |
| 26 | 26 | export type CerographClass = z.infer<typeof CerographClassSchema>; |
| 27 | 27 | |
| 28 | 28 | export const ChemotherapeuticClassSchema = z.object({ |
| @@ -51,7 +51,7 @@ export const ChemotherapeuticClassSchema = z.object({ | ||
| 51 | 51 | "stagmometer": z.null().optional(), |
| 52 | 52 | "tetherball": z.null().optional(), |
| 53 | 53 | "unshy": z.null().optional(), |
| 54 | -}); | |
| 54 | +}).strict(); | |
| 55 | 55 | export type ChemotherapeuticClass = z.infer<typeof ChemotherapeuticClassSchema>; |
| 56 | 56 | |
| 57 | 57 | export const CimeliaClassSchema = z.object({ |
| @@ -60,7 +60,7 @@ export const CimeliaClassSchema = z.object({ | ||
| 60 | 60 | "disdiapason": z.string(), |
| 61 | 61 | "homocerc": z.boolean(), |
| 62 | 62 | "nonbookish": z.null(), |
| 63 | -}); | |
| 63 | +}).strict(); | |
| 64 | 64 | export type CimeliaClass = z.infer<typeof CimeliaClassSchema>; |
| 65 | 65 | |
| 66 | 66 | export const CoadjustClassSchema = z.object({ |
| @@ -89,7 +89,7 @@ export const CoadjustClassSchema = z.object({ | ||
| 89 | 89 | "symbiot": z.null().optional(), |
| 90 | 90 | "tablefellow": z.null().optional(), |
| 91 | 91 | "unchargeable": z.null().optional(), |
| 92 | -}); | |
| 92 | +}).strict(); | |
| 93 | 93 | export type CoadjustClass = z.infer<typeof CoadjustClassSchema>; |
| 94 | 94 | |
| 95 | 95 | export const CredulityClassSchema = z.object({ |
| @@ -113,7 +113,7 @@ export const CredulityClassSchema = z.object({ | ||
| 113 | 113 | "seriality": z.null(), |
| 114 | 114 | "vamphorn": z.null(), |
| 115 | 115 | "wharp": z.null(), |
| 116 | -}); | |
| 116 | +}).strict(); | |
| 117 | 117 | export type CredulityClass = z.infer<typeof CredulityClassSchema>; |
| 118 | 118 | |
| 119 | 119 | export const DeruralizeClassSchema = z.object({ |
| @@ -137,7 +137,7 @@ export const DeruralizeClassSchema = z.object({ | ||
| 137 | 137 | "unnicked": z.null(), |
| 138 | 138 | "unstavable": z.null(), |
| 139 | 139 | "windfirm": z.null(), |
| 140 | -}); | |
| 140 | +}).strict(); | |
| 141 | 141 | export type DeruralizeClass = z.infer<typeof DeruralizeClassSchema>; |
| 142 | 142 | |
| 143 | 143 | export const DiaereseClassSchema = z.object({ |
| @@ -161,7 +161,7 @@ export const DiaereseClassSchema = z.object({ | ||
| 161 | 161 | "silker": z.null(), |
| 162 | 162 | "subdentated": z.null(), |
| 163 | 163 | "subobscure": z.null(), |
| 164 | -}); | |
| 164 | +}).strict(); | |
| 165 | 165 | export type DiaereseClass = z.infer<typeof DiaereseClassSchema>; |
| 166 | 166 | |
| 167 | 167 | export const EncrustSchema = z.object({ |
| @@ -185,7 +185,7 @@ export const EncrustSchema = z.object({ | ||
| 185 | 185 | "ungyved": z.null(), |
| 186 | 186 | "whirlabout": z.null(), |
| 187 | 187 | "woodenware": z.null(), |
| 188 | -}); | |
| 188 | +}).strict(); | |
| 189 | 189 | export type Encrust = z.infer<typeof EncrustSchema>; |
| 190 | 190 | |
| 191 | 191 | export const FagginglyClassSchema = z.object({ |
| @@ -209,7 +209,7 @@ export const FagginglyClassSchema = z.object({ | ||
| 209 | 209 | "soleas": z.null(), |
| 210 | 210 | "unfastenable": z.null(), |
| 211 | 211 | "unmillinered": z.null(), |
| 212 | -}); | |
| 212 | +}).strict(); | |
| 213 | 213 | export type FagginglyClass = z.infer<typeof FagginglyClassSchema>; |
| 214 | 214 | |
| 215 | 215 | export const FenkClassSchema = z.object({ |
| @@ -233,7 +233,7 @@ export const FenkClassSchema = z.object({ | ||
| 233 | 233 | "Tritoness": z.null(), |
| 234 | 234 | "undergrade": z.null(), |
| 235 | 235 | "undermountain": z.null(), |
| 236 | -}); | |
| 236 | +}).strict(); | |
| 237 | 237 | export type FenkClass = z.infer<typeof FenkClassSchema>; |
| 238 | 238 | |
| 239 | 239 | export const FlagmakingClassSchema = z.object({ |
| @@ -257,7 +257,7 @@ export const FlagmakingClassSchema = z.object({ | ||
| 257 | 257 | "unloveliness": z.null(), |
| 258 | 258 | "unquarantined": z.null(), |
| 259 | 259 | "unrenounceable": z.null(), |
| 260 | -}); | |
| 260 | +}).strict(); | |
| 261 | 261 | export type FlagmakingClass = z.infer<typeof FlagmakingClassSchema>; |
| 262 | 262 | |
| 263 | 263 | export const HemocoeleClassSchema = z.object({ |
| @@ -286,7 +286,7 @@ export const HemocoeleClassSchema = z.object({ | ||
| 286 | 286 | "untutelar": z.null().optional(), |
| 287 | 287 | "vagrant": z.null().optional(), |
| 288 | 288 | "Walt": z.null().optional(), |
| 289 | -}); | |
| 289 | +}).strict(); | |
| 290 | 290 | export type HemocoeleClass = z.infer<typeof HemocoeleClassSchema>; |
| 291 | 291 | |
| 292 | 292 | export const InteracinarSchema = z.object({ |
| @@ -295,7 +295,7 @@ export const InteracinarSchema = z.object({ | ||
| 295 | 295 | "triseriatim": z.string(), |
| 296 | 296 | "tubbing": z.number().int(), |
| 297 | 297 | "untrimmed": z.null(), |
| 298 | -}); | |
| 298 | +}).strict(); | |
| 299 | 299 | export type Interacinar = z.infer<typeof InteracinarSchema>; |
| 300 | 300 | |
| 301 | 301 | export const TopLevelSchema = z.object({ |
| @@ -342,5 +342,5 @@ export const TopLevelSchema = z.object({ | ||
| 342 | 342 | "interacinar": InteracinarSchema, |
| 343 | 343 | "intercorrelation": z.array(z.union([z.null(), z.array(z.number().int())])), |
| 344 | 344 | "jacutinga": z.array(z.union([z.array(z.number().int()), z.record(z.string(), z.union([z.null(), z.number().int()]))])), |
| 345 | -}); | |
| 345 | +}).strict(); | |
| 346 | 346 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +11 −11test/inputs/json/priority/combinations2.json
Mtypescript-zoddefault / TopLevel.ts+11 −11
| @@ -22,7 +22,7 @@ export const AlleviateClassSchema = z.object({ | ||
| 22 | 22 | "unparking": z.null(), |
| 23 | 23 | "unvarnishedness": z.null(), |
| 24 | 24 | "wherewithal": z.null(), |
| 25 | -}); | |
| 25 | +}).strict(); | |
| 26 | 26 | export type AlleviateClass = z.infer<typeof AlleviateClassSchema>; |
| 27 | 27 | |
| 28 | 28 | export const RebeccaSchema = z.object({ |
| @@ -31,7 +31,7 @@ export const RebeccaSchema = z.object({ | ||
| 31 | 31 | "disdiapason": z.string(), |
| 32 | 32 | "homocerc": z.boolean(), |
| 33 | 33 | "nonbookish": z.null(), |
| 34 | -}); | |
| 34 | +}).strict(); | |
| 35 | 35 | export type Rebecca = z.infer<typeof RebeccaSchema>; |
| 36 | 36 | |
| 37 | 37 | export const AmphithyronSchema = z.object({ |
| @@ -60,7 +60,7 @@ export const AmphithyronSchema = z.object({ | ||
| 60 | 60 | "stagnum": z.number().int().optional(), |
| 61 | 61 | "Those": z.number().int().optional(), |
| 62 | 62 | "undecimal": z.number().int().optional(), |
| 63 | -}); | |
| 63 | +}).strict(); | |
| 64 | 64 | export type Amphithyron = z.infer<typeof AmphithyronSchema>; |
| 65 | 65 | |
| 66 | 66 | export const AnkeeClassSchema = z.object({ |
| @@ -84,7 +84,7 @@ export const AnkeeClassSchema = z.object({ | ||
| 84 | 84 | "tracheophone": z.null(), |
| 85 | 85 | "tuglike": z.null(), |
| 86 | 86 | "unscratchingly": z.null(), |
| 87 | -}); | |
| 87 | +}).strict(); | |
| 88 | 88 | export type AnkeeClass = z.infer<typeof AnkeeClassSchema>; |
| 89 | 89 | |
| 90 | 90 | export const AnsarieClassSchema = z.object({ |
| @@ -108,7 +108,7 @@ export const AnsarieClassSchema = z.object({ | ||
| 108 | 108 | "water": z.null(), |
| 109 | 109 | "zestfully": z.null(), |
| 110 | 110 | "zincic": z.null(), |
| 111 | -}); | |
| 111 | +}).strict(); | |
| 112 | 112 | export type AnsarieClass = z.infer<typeof AnsarieClassSchema>; |
| 113 | 113 | |
| 114 | 114 | export const ChytridiaceaeClassSchema = z.object({ |
| @@ -132,7 +132,7 @@ export const ChytridiaceaeClassSchema = z.object({ | ||
| 132 | 132 | "uckia": z.null(), |
| 133 | 133 | "unmettle": z.null(), |
| 134 | 134 | "vorticellid": z.null(), |
| 135 | -}); | |
| 135 | +}).strict(); | |
| 136 | 136 | export type ChytridiaceaeClass = z.infer<typeof ChytridiaceaeClassSchema>; |
| 137 | 137 | |
| 138 | 138 | export const DiscordiaClassSchema = z.object({ |
| @@ -161,7 +161,7 @@ export const DiscordiaClassSchema = z.object({ | ||
| 161 | 161 | "swow": z.number().int().optional(), |
| 162 | 162 | "wastrel": z.number().int().optional(), |
| 163 | 163 | "wingle": z.number().int().optional(), |
| 164 | -}); | |
| 164 | +}).strict(); | |
| 165 | 165 | export type DiscordiaClass = z.infer<typeof DiscordiaClassSchema>; |
| 166 | 166 | |
| 167 | 167 | export const GryphosaurusClassSchema = z.object({ |
| @@ -185,7 +185,7 @@ export const GryphosaurusClassSchema = z.object({ | ||
| 185 | 185 | "Tahami": z.null(), |
| 186 | 186 | "undaubed": z.null(), |
| 187 | 187 | "underntime": z.null(), |
| 188 | -}); | |
| 188 | +}).strict(); | |
| 189 | 189 | export type GryphosaurusClass = z.infer<typeof GryphosaurusClassSchema>; |
| 190 | 190 | |
| 191 | 191 | export const LaviniaClassSchema = z.object({ |
| @@ -214,7 +214,7 @@ export const LaviniaClassSchema = z.object({ | ||
| 214 | 214 | "tranquillize": z.number().int().optional(), |
| 215 | 215 | "unquestionable": z.number().int().optional(), |
| 216 | 216 | "uproute": z.number().int().optional(), |
| 217 | -}); | |
| 217 | +}).strict(); | |
| 218 | 218 | export type LaviniaClass = z.infer<typeof LaviniaClassSchema>; |
| 219 | 219 | |
| 220 | 220 | export const OskarClassSchema = z.object({ |
| @@ -238,7 +238,7 @@ export const OskarClassSchema = z.object({ | ||
| 238 | 238 | "teachment": z.null(), |
| 239 | 239 | "unmutinous": z.null(), |
| 240 | 240 | "unstoppable": z.null(), |
| 241 | -}); | |
| 241 | +}).strict(); | |
| 242 | 242 | export type OskarClass = z.infer<typeof OskarClassSchema>; |
| 243 | 243 | |
| 244 | 244 | export const TopLevelSchema = z.object({ |
| @@ -287,5 +287,5 @@ export const TopLevelSchema = z.object({ | ||
| 287 | 287 | "Shakespearolater": z.array(z.union([z.array(z.number().int()), z.number(), z.string()])), |
| 288 | 288 | "Svan": z.array(z.number()), |
| 289 | 289 | "Wayao": z.record(z.string(), z.number()), |
| 290 | -}); | |
| 290 | +}).strict(); | |
| 291 | 291 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +15 −15test/inputs/json/priority/combinations3.json
Mtypescript-zoddefault / TopLevel.ts+15 −15
| @@ -22,7 +22,7 @@ export const JurorClassSchema = z.object({ | ||
| 22 | 22 | "uncontemporary": z.null(), |
| 23 | 23 | "uncouched": z.null(), |
| 24 | 24 | "uninhabitedness": z.null(), |
| 25 | -}); | |
| 25 | +}).strict(); | |
| 26 | 26 | export type JurorClass = z.infer<typeof JurorClassSchema>; |
| 27 | 27 | |
| 28 | 28 | export const LadronismClassSchema = z.object({ |
| @@ -46,7 +46,7 @@ export const LadronismClassSchema = z.object({ | ||
| 46 | 46 | "uplook": z.null(), |
| 47 | 47 | "vermiformis": z.null(), |
| 48 | 48 | "whafabout": z.null(), |
| 49 | -}); | |
| 49 | +}).strict(); | |
| 50 | 50 | export type LadronismClass = z.infer<typeof LadronismClassSchema>; |
| 51 | 51 | |
| 52 | 52 | export const LandlubberlyClassSchema = z.object({ |
| @@ -70,7 +70,7 @@ export const LandlubberlyClassSchema = z.object({ | ||
| 70 | 70 | "saddling": z.null(), |
| 71 | 71 | "subcurrent": z.null(), |
| 72 | 72 | "unrecriminative": z.null(), |
| 73 | -}); | |
| 73 | +}).strict(); | |
| 74 | 74 | export type LandlubberlyClass = z.infer<typeof LandlubberlyClassSchema>; |
| 75 | 75 | |
| 76 | 76 | export const LupusClassSchema = z.object({ |
| @@ -99,7 +99,7 @@ export const LupusClassSchema = z.object({ | ||
| 99 | 99 | "unsignificantly": z.number().int().optional(), |
| 100 | 100 | "unsnap": z.number().int().optional(), |
| 101 | 101 | "vendible": z.number().int().optional(), |
| 102 | -}); | |
| 102 | +}).strict(); | |
| 103 | 103 | export type LupusClass = z.infer<typeof LupusClassSchema>; |
| 104 | 104 | |
| 105 | 105 | export const MaslinSchema = z.object({ |
| @@ -148,7 +148,7 @@ export const MaslinSchema = z.object({ | ||
| 148 | 148 | "unassuaged": z.number().int().optional(), |
| 149 | 149 | "ungross": z.null().optional(), |
| 150 | 150 | "unjudiciously": z.null().optional(), |
| 151 | -}); | |
| 151 | +}).strict(); | |
| 152 | 152 | export type Maslin = z.infer<typeof MaslinSchema>; |
| 153 | 153 | |
| 154 | 154 | export const MonaziteClassSchema = z.object({ |
| @@ -157,7 +157,7 @@ export const MonaziteClassSchema = z.object({ | ||
| 157 | 157 | "disdiapason": z.string(), |
| 158 | 158 | "homocerc": z.boolean(), |
| 159 | 159 | "nonbookish": z.null(), |
| 160 | -}); | |
| 160 | +}).strict(); | |
| 161 | 161 | export type MonaziteClass = z.infer<typeof MonaziteClassSchema>; |
| 162 | 162 | |
| 163 | 163 | export const MonotheisticallyClassSchema = z.object({ |
| @@ -186,7 +186,7 @@ export const MonotheisticallyClassSchema = z.object({ | ||
| 186 | 186 | "superedification": z.null().optional(), |
| 187 | 187 | "trust": z.null().optional(), |
| 188 | 188 | "whitestone": z.null().optional(), |
| 189 | -}); | |
| 189 | +}).strict(); | |
| 190 | 190 | export type MonotheisticallyClass = z.infer<typeof MonotheisticallyClassSchema>; |
| 191 | 191 | |
| 192 | 192 | export const NoncontributingSchema = z.object({ |
| @@ -195,7 +195,7 @@ export const NoncontributingSchema = z.object({ | ||
| 195 | 195 | "sauternes": z.number().int(), |
| 196 | 196 | "sparsely": z.boolean(), |
| 197 | 197 | "unrequested": z.null(), |
| 198 | -}); | |
| 198 | +}).strict(); | |
| 199 | 199 | export type Noncontributing = z.infer<typeof NoncontributingSchema>; |
| 200 | 200 | |
| 201 | 201 | export const OccupationalistClassSchema = z.object({ |
| @@ -219,7 +219,7 @@ export const OccupationalistClassSchema = z.object({ | ||
| 219 | 219 | "tingitid": z.null(), |
| 220 | 220 | "trailless": z.null(), |
| 221 | 221 | "unpocketed": z.null(), |
| 222 | -}); | |
| 222 | +}).strict(); | |
| 223 | 223 | export type OccupationalistClass = z.infer<typeof OccupationalistClassSchema>; |
| 224 | 224 | |
| 225 | 225 | export const OutrivalClassSchema = z.object({ |
| @@ -243,7 +243,7 @@ export const OutrivalClassSchema = z.object({ | ||
| 243 | 243 | "rebellious": z.null(), |
| 244 | 244 | "recodify": z.null(), |
| 245 | 245 | "unpaced": z.null(), |
| 246 | -}); | |
| 246 | +}).strict(); | |
| 247 | 247 | export type OutrivalClass = z.infer<typeof OutrivalClassSchema>; |
| 248 | 248 | |
| 249 | 249 | export const PiaculumClassSchema = z.object({ |
| @@ -272,7 +272,7 @@ export const PiaculumClassSchema = z.object({ | ||
| 272 | 272 | "thorax": z.number().int().optional(), |
| 273 | 273 | "yachting": z.number().int().optional(), |
| 274 | 274 | "Zipper": z.number().int().optional(), |
| 275 | -}); | |
| 275 | +}).strict(); | |
| 276 | 276 | export type PiaculumClass = z.infer<typeof PiaculumClassSchema>; |
| 277 | 277 | |
| 278 | 278 | export const PneumoceleSchema = z.object({ |
| @@ -301,7 +301,7 @@ export const PneumoceleSchema = z.object({ | ||
| 301 | 301 | "taillight": z.null().optional(), |
| 302 | 302 | "unjealous": z.null().optional(), |
| 303 | 303 | "visitorial": z.null().optional(), |
| 304 | -}); | |
| 304 | +}).strict(); | |
| 305 | 305 | export type Pneumocele = z.infer<typeof PneumoceleSchema>; |
| 306 | 306 | |
| 307 | 307 | export const PotwhiskyClassSchema = z.object({ |
| @@ -325,7 +325,7 @@ export const PotwhiskyClassSchema = z.object({ | ||
| 325 | 325 | "thrashel": z.null(), |
| 326 | 326 | "tyremesis": z.null(), |
| 327 | 327 | "Yoruba": z.null(), |
| 328 | -}); | |
| 328 | +}).strict(); | |
| 329 | 329 | export type PotwhiskyClass = z.infer<typeof PotwhiskyClassSchema>; |
| 330 | 330 | |
| 331 | 331 | export const PrefreshmanClassSchema = z.object({ |
| @@ -349,7 +349,7 @@ export const PrefreshmanClassSchema = z.object({ | ||
| 349 | 349 | "scutatiform": z.null(), |
| 350 | 350 | "theodolite": z.null(), |
| 351 | 351 | "underward": z.null(), |
| 352 | -}); | |
| 352 | +}).strict(); | |
| 353 | 353 | export type PrefreshmanClass = z.infer<typeof PrefreshmanClassSchema>; |
| 354 | 354 | |
| 355 | 355 | export const TopLevelSchema = z.object({ |
| @@ -395,5 +395,5 @@ export const TopLevelSchema = z.object({ | ||
| 395 | 395 | "prevoidance": z.array(z.union([z.array(z.number().int()), MonaziteClassSchema, z.number().int()])), |
| 396 | 396 | "probant": z.array(z.record(z.string(), z.union([z.null(), z.number().int()]))), |
| 397 | 397 | "protext": z.array(z.union([z.array(z.number().int()), z.boolean(), MonaziteClassSchema])), |
| 398 | -}); | |
| 398 | +}).strict(); | |
| 399 | 399 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +17 −17test/inputs/json/priority/combinations4.json
Mtypescript-zoddefault / TopLevel.ts+17 −17
| @@ -22,7 +22,7 @@ export const PulpitismClassSchema = z.object({ | ||
| 22 | 22 | "syllabe": z.null(), |
| 23 | 23 | "toughhead": z.null(), |
| 24 | 24 | "underburn": z.null(), |
| 25 | -}); | |
| 25 | +}).strict(); | |
| 26 | 26 | export type PulpitismClass = z.infer<typeof PulpitismClassSchema>; |
| 27 | 27 | |
| 28 | 28 | export const PyodermiaClassSchema = z.object({ |
| @@ -46,7 +46,7 @@ export const PyodermiaClassSchema = z.object({ | ||
| 46 | 46 | "unclothedly": z.null(), |
| 47 | 47 | "unimplied": z.null(), |
| 48 | 48 | "unsyncopated": z.null(), |
| 49 | -}); | |
| 49 | +}).strict(); | |
| 50 | 50 | export type PyodermiaClass = z.infer<typeof PyodermiaClassSchema>; |
| 51 | 51 | |
| 52 | 52 | export const QuebrachineClassSchema = z.object({ |
| @@ -55,7 +55,7 @@ export const QuebrachineClassSchema = z.object({ | ||
| 55 | 55 | "disdiapason": z.string(), |
| 56 | 56 | "homocerc": z.boolean(), |
| 57 | 57 | "nonbookish": z.null(), |
| 58 | -}); | |
| 58 | +}).strict(); | |
| 59 | 59 | export type QuebrachineClass = z.infer<typeof QuebrachineClassSchema>; |
| 60 | 60 | |
| 61 | 61 | export const ReimagineSchema = z.object({ |
| @@ -84,7 +84,7 @@ export const ReimagineSchema = z.object({ | ||
| 84 | 84 | "subdie": z.null().optional(), |
| 85 | 85 | "tibiometatarsal": z.null().optional(), |
| 86 | 86 | "waltzlike": z.null().optional(), |
| 87 | -}); | |
| 87 | +}).strict(); | |
| 88 | 88 | export type Reimagine = z.infer<typeof ReimagineSchema>; |
| 89 | 89 | |
| 90 | 90 | export const RessautSchema = z.object({ |
| @@ -108,7 +108,7 @@ export const RessautSchema = z.object({ | ||
| 108 | 108 | "Theopaschitism": z.string(), |
| 109 | 109 | "undurableness": z.string(), |
| 110 | 110 | "unmingleable": z.string(), |
| 111 | -}); | |
| 111 | +}).strict(); | |
| 112 | 112 | export type Ressaut = z.infer<typeof RessautSchema>; |
| 113 | 113 | |
| 114 | 114 | export const RewriteClassSchema = z.object({ |
| @@ -132,7 +132,7 @@ export const RewriteClassSchema = z.object({ | ||
| 132 | 132 | "vertical": z.null(), |
| 133 | 133 | "Whiggification": z.null(), |
| 134 | 134 | "yardman": z.null(), |
| 135 | -}); | |
| 135 | +}).strict(); | |
| 136 | 136 | export type RewriteClass = z.infer<typeof RewriteClassSchema>; |
| 137 | 137 | |
| 138 | 138 | export const SantirClassSchema = z.object({ |
| @@ -156,7 +156,7 @@ export const SantirClassSchema = z.object({ | ||
| 156 | 156 | "timelily": z.null(), |
| 157 | 157 | "unprofaned": z.null(), |
| 158 | 158 | "vorticular": z.null(), |
| 159 | -}); | |
| 159 | +}).strict(); | |
| 160 | 160 | export type SantirClass = z.infer<typeof SantirClassSchema>; |
| 161 | 161 | |
| 162 | 162 | export const SaxtenClassSchema = z.object({ |
| @@ -185,7 +185,7 @@ export const SaxtenClassSchema = z.object({ | ||
| 185 | 185 | "trunchman": z.null().optional(), |
| 186 | 186 | "urger": z.null().optional(), |
| 187 | 187 | "withdrawnness": z.null().optional(), |
| 188 | -}); | |
| 188 | +}).strict(); | |
| 189 | 189 | export type SaxtenClass = z.infer<typeof SaxtenClassSchema>; |
| 190 | 190 | |
| 191 | 191 | export const ScattySchema = z.object({ |
| @@ -209,7 +209,7 @@ export const ScattySchema = z.object({ | ||
| 209 | 209 | "Tabasco": z.null(), |
| 210 | 210 | "teleianthous": z.null(), |
| 211 | 211 | "uncombated": z.null(), |
| 212 | -}); | |
| 212 | +}).strict(); | |
| 213 | 213 | export type Scatty = z.infer<typeof ScattySchema>; |
| 214 | 214 | |
| 215 | 215 | export const SisteringClassSchema = z.object({ |
| @@ -233,7 +233,7 @@ export const SisteringClassSchema = z.object({ | ||
| 233 | 233 | "unmixable": z.null(), |
| 234 | 234 | "untruckling": z.null(), |
| 235 | 235 | "vineal": z.null(), |
| 236 | -}); | |
| 236 | +}).strict(); | |
| 237 | 237 | export type SisteringClass = z.infer<typeof SisteringClassSchema>; |
| 238 | 238 | |
| 239 | 239 | export const StaghuntingSchema = z.object({ |
| @@ -262,7 +262,7 @@ export const StaghuntingSchema = z.object({ | ||
| 262 | 262 | "trifid": z.number().int().optional(), |
| 263 | 263 | "undefeatedly": z.number().int().optional(), |
| 264 | 264 | "ungirlish": z.number().int().optional(), |
| 265 | -}); | |
| 265 | +}).strict(); | |
| 266 | 266 | export type Staghunting = z.infer<typeof StaghuntingSchema>; |
| 267 | 267 | |
| 268 | 268 | export const StrenuosityClassSchema = z.object({ |
| @@ -291,7 +291,7 @@ export const StrenuosityClassSchema = z.object({ | ||
| 291 | 291 | "undueness": z.number().int().optional(), |
| 292 | 292 | "worthily": z.number().int().optional(), |
| 293 | 293 | "Yankeeist": z.number().int().optional(), |
| 294 | -}); | |
| 294 | +}).strict(); | |
| 295 | 295 | export type StrenuosityClass = z.infer<typeof StrenuosityClassSchema>; |
| 296 | 296 | |
| 297 | 297 | export const TruantcyClassSchema = z.object({ |
| @@ -320,7 +320,7 @@ export const TruantcyClassSchema = z.object({ | ||
| 320 | 320 | "skelder": z.null().optional(), |
| 321 | 321 | "windwaywardly": z.null().optional(), |
| 322 | 322 | "Yuman": z.null().optional(), |
| 323 | -}); | |
| 323 | +}).strict(); | |
| 324 | 324 | export type TruantcyClass = z.infer<typeof TruantcyClassSchema>; |
| 325 | 325 | |
| 326 | 326 | export const UnimpeachablyClassSchema = z.object({ |
| @@ -349,7 +349,7 @@ export const UnimpeachablyClassSchema = z.object({ | ||
| 349 | 349 | "tussocker": z.number().int().optional(), |
| 350 | 350 | "ultraproud": z.number().int().optional(), |
| 351 | 351 | "unsuggestedness": z.number().int().optional(), |
| 352 | -}); | |
| 352 | +}).strict(); | |
| 353 | 353 | export type UnimpeachablyClass = z.infer<typeof UnimpeachablyClassSchema>; |
| 354 | 354 | |
| 355 | 355 | export const UnstressedClassSchema = z.object({ |
| @@ -373,7 +373,7 @@ export const UnstressedClassSchema = z.object({ | ||
| 373 | 373 | "undecreed": z.null(), |
| 374 | 374 | "venerable": z.null(), |
| 375 | 375 | "vowellessness": z.null(), |
| 376 | -}); | |
| 376 | +}).strict(); | |
| 377 | 377 | export type UnstressedClass = z.infer<typeof UnstressedClassSchema>; |
| 378 | 378 | |
| 379 | 379 | export const WrothyClassSchema = z.object({ |
| @@ -397,7 +397,7 @@ export const WrothyClassSchema = z.object({ | ||
| 397 | 397 | "transhumance": z.null(), |
| 398 | 398 | "triandrian": z.null(), |
| 399 | 399 | "unbooked": z.null(), |
| 400 | -}); | |
| 400 | +}).strict(); | |
| 401 | 401 | export type WrothyClass = z.infer<typeof WrothyClassSchema>; |
| 402 | 402 | |
| 403 | 403 | export const TopLevelSchema = z.object({ |
| @@ -453,5 +453,5 @@ export const TopLevelSchema = z.object({ | ||
| 453 | 453 | "warriorship": z.record(z.string(), z.boolean()), |
| 454 | 454 | "whitepot": z.array(z.union([QuebrachineClassSchema, z.number()])), |
| 455 | 455 | "wrothy": z.array(z.union([z.array(z.null()), WrothyClassSchema])), |
| 456 | -}); | |
| 456 | +}).strict(); | |
| 457 | 457 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/json/priority/combined-enum.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -10,11 +10,11 @@ export type X = z.infer<typeof XSchema>; | ||
| 10 | 10 | |
| 11 | 11 | export const BarSchema = z.object({ |
| 12 | 12 | "x": XSchema, |
| 13 | -}); | |
| 13 | +}).strict(); | |
| 14 | 14 | export type Bar = z.infer<typeof BarSchema>; |
| 15 | 15 | |
| 16 | 16 | export const TopLevelSchema = z.object({ |
| 17 | 17 | "bar": z.array(BarSchema), |
| 18 | 18 | "foo": z.array(BarSchema), |
| 19 | -}); | |
| 19 | +}).strict(); | |
| 20 | 20 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/priority/direct-recursive.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -15,5 +15,5 @@ export const TopLevelSchema: z.ZodType<TopLevel> = z.lazy(() => | ||
| 15 | 15 | "foo": z.number().int(), |
| 16 | 16 | "moo": z.number(), |
| 17 | 17 | "quux": z.string(), |
| 18 | - }) | |
| 18 | + }).strict() | |
| 19 | 19 | ); |
Test case
1 generated file · +2 −2test/inputs/json/priority/empty-enum.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -3,10 +3,10 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const FooSchema = z.object({ |
| 5 | 5 | "bar": z.string().optional(), |
| 6 | -}); | |
| 6 | +}).strict(); | |
| 7 | 7 | export type Foo = z.infer<typeof FooSchema>; |
| 8 | 8 | |
| 9 | 9 | export const TopLevelSchema = z.object({ |
| 10 | 10 | "foo": z.array(FooSchema), |
| 11 | -}); | |
| 11 | +}).strict(); | |
| 12 | 12 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +7 −7test/inputs/json/priority/identifiers.json
Mtypescript-zoddefault / TopLevel.ts+7 −7
| @@ -3,34 +3,34 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const TopLevelBlaSchema = z.object({ |
| 5 | 5 | "bar": z.number().int(), |
| 6 | -}); | |
| 6 | +}).strict(); | |
| 7 | 7 | export type TopLevelBla = z.infer<typeof TopLevelBlaSchema>; |
| 8 | 8 | |
| 9 | 9 | export const EmptySchema = z.object({ |
| 10 | 10 | "x": z.number().int(), |
| 11 | -}); | |
| 11 | +}).strict(); | |
| 12 | 12 | export type Empty = z.infer<typeof EmptySchema>; |
| 13 | 13 | |
| 14 | 14 | export const FooBlaSchema = z.object({ |
| 15 | -}); | |
| 15 | +}).strict(); | |
| 16 | 16 | export type FooBla = z.infer<typeof FooBlaSchema>; |
| 17 | 17 | |
| 18 | 18 | export const ThisIsAToughOneSchema = z.object({ |
| 19 | 19 | "\n\n\n": z.number().int(), |
| 20 | 20 | "\"": z.number().int(), |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type ThisIsAToughOne = z.infer<typeof ThisIsAToughOneSchema>; |
| 23 | 23 | |
| 24 | 24 | export const EmptyClassSchema = z.object({ |
| 25 | 25 | "y": z.number().int(), |
| 26 | -}); | |
| 26 | +}).strict(); | |
| 27 | 27 | export type EmptyClass = z.infer<typeof EmptyClassSchema>; |
| 28 | 28 | |
| 29 | 29 | export const FooSchema = z.object({ |
| 30 | 30 | "bla": FooBlaSchema, |
| 31 | 31 | "_": z.number().int(), |
| 32 | 32 | "__": z.number().int(), |
| 33 | -}); | |
| 33 | +}).strict(); | |
| 34 | 34 | export type Foo = z.infer<typeof FooSchema>; |
| 35 | 35 | |
| 36 | 36 | export const TopLevelSchema = z.object({ |
| @@ -40,5 +40,5 @@ export const TopLevelSchema = z.object({ | ||
| 40 | 40 | "ThisIsA\ud83d\ude1cTough\"\n\nOne": ThisIsAToughOneSchema, |
| 41 | 41 | "!": z.number().int(), |
| 42 | 42 | "Empty": EmptyClassSchema, |
| 43 | -}); | |
| 43 | +}).strict(); | |
| 44 | 44 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/priority/issue2680-object-array.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -3,7 +3,7 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const TopLevelElementSchema = z.object({ |
| 5 | 5 | "key": z.string(), |
| 6 | -}); | |
| 6 | +}).strict(); | |
| 7 | 7 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 8 | 8 | |
| 9 | 9 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +285 −285test/inputs/json/priority/keywords.json
Mtypescript-zoddefault / TopLevel.ts+285 −285
| @@ -3,1397 +3,1397 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const AbstractSchema = z.object({ |
| 5 | 5 | "abstract": z.number().int(), |
| 6 | -}); | |
| 6 | +}).strict(); | |
| 7 | 7 | export type Abstract = z.infer<typeof AbstractSchema>; |
| 8 | 8 | |
| 9 | 9 | export const AlignasSchema = z.object({ |
| 10 | 10 | "alignas": z.number().int(), |
| 11 | -}); | |
| 11 | +}).strict(); | |
| 12 | 12 | export type Alignas = z.infer<typeof AlignasSchema>; |
| 13 | 13 | |
| 14 | 14 | export const AlignofSchema = z.object({ |
| 15 | 15 | "alignof": z.number().int(), |
| 16 | -}); | |
| 16 | +}).strict(); | |
| 17 | 17 | export type Alignof = z.infer<typeof AlignofSchema>; |
| 18 | 18 | |
| 19 | 19 | export const AndSchema = z.object({ |
| 20 | 20 | "and": z.number().int(), |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type And = z.infer<typeof AndSchema>; |
| 23 | 23 | |
| 24 | 24 | export const AndEqSchema = z.object({ |
| 25 | 25 | "and_eq": z.number().int(), |
| 26 | -}); | |
| 26 | +}).strict(); | |
| 27 | 27 | export type AndEq = z.infer<typeof AndEqSchema>; |
| 28 | 28 | |
| 29 | 29 | export const AnySchema = z.object({ |
| 30 | 30 | "Any": z.number().int(), |
| 31 | -}); | |
| 31 | +}).strict(); | |
| 32 | 32 | export type Any = z.infer<typeof AnySchema>; |
| 33 | 33 | |
| 34 | 34 | export const ArrayClassSchema = z.object({ |
| 35 | 35 | "array": z.number().int(), |
| 36 | -}); | |
| 36 | +}).strict(); | |
| 37 | 37 | export type ArrayClass = z.infer<typeof ArrayClassSchema>; |
| 38 | 38 | |
| 39 | 39 | export const AsSchema = z.object({ |
| 40 | 40 | "as": z.number().int(), |
| 41 | -}); | |
| 41 | +}).strict(); | |
| 42 | 42 | export type As = z.infer<typeof AsSchema>; |
| 43 | 43 | |
| 44 | 44 | export const AsmSchema = z.object({ |
| 45 | 45 | "asm": z.number().int(), |
| 46 | -}); | |
| 46 | +}).strict(); | |
| 47 | 47 | export type Asm = z.infer<typeof AsmSchema>; |
| 48 | 48 | |
| 49 | 49 | export const AssertSchema = z.object({ |
| 50 | 50 | "assert": z.number().int(), |
| 51 | -}); | |
| 51 | +}).strict(); | |
| 52 | 52 | export type Assert = z.infer<typeof AssertSchema>; |
| 53 | 53 | |
| 54 | 54 | export const AssociatedtypeSchema = z.object({ |
| 55 | 55 | "associatedtype": z.number().int(), |
| 56 | -}); | |
| 56 | +}).strict(); | |
| 57 | 57 | export type Associatedtype = z.infer<typeof AssociatedtypeSchema>; |
| 58 | 58 | |
| 59 | 59 | export const AssociativitySchema = z.object({ |
| 60 | 60 | "associativity": z.number().int(), |
| 61 | -}); | |
| 61 | +}).strict(); | |
| 62 | 62 | export type Associativity = z.infer<typeof AssociativitySchema>; |
| 63 | 63 | |
| 64 | 64 | export const AsyncSchema = z.object({ |
| 65 | 65 | "async": z.number().int(), |
| 66 | -}); | |
| 66 | +}).strict(); | |
| 67 | 67 | export type Async = z.infer<typeof AsyncSchema>; |
| 68 | 68 | |
| 69 | 69 | export const AtomicSchema = z.object({ |
| 70 | 70 | "atomic": z.number().int(), |
| 71 | -}); | |
| 71 | +}).strict(); | |
| 72 | 72 | export type Atomic = z.infer<typeof AtomicSchema>; |
| 73 | 73 | |
| 74 | 74 | export const AtomicCancelSchema = z.object({ |
| 75 | 75 | "atomic_cancel": z.number().int(), |
| 76 | -}); | |
| 76 | +}).strict(); | |
| 77 | 77 | export type AtomicCancel = z.infer<typeof AtomicCancelSchema>; |
| 78 | 78 | |
| 79 | 79 | export const AtomicCommitSchema = z.object({ |
| 80 | 80 | "atomic_commit": z.number().int(), |
| 81 | -}); | |
| 81 | +}).strict(); | |
| 82 | 82 | export type AtomicCommit = z.infer<typeof AtomicCommitSchema>; |
| 83 | 83 | |
| 84 | 84 | export const AtomicNoexceptSchema = z.object({ |
| 85 | 85 | "atomic_noexcept": z.number().int(), |
| 86 | -}); | |
| 86 | +}).strict(); | |
| 87 | 87 | export type AtomicNoexcept = z.infer<typeof AtomicNoexceptSchema>; |
| 88 | 88 | |
| 89 | 89 | export const AutoSchema = z.object({ |
| 90 | 90 | "auto": z.number().int(), |
| 91 | -}); | |
| 91 | +}).strict(); | |
| 92 | 92 | export type Auto = z.infer<typeof AutoSchema>; |
| 93 | 93 | |
| 94 | 94 | export const AwaitSchema = z.object({ |
| 95 | 95 | "await": z.number().int(), |
| 96 | -}); | |
| 96 | +}).strict(); | |
| 97 | 97 | export type Await = z.infer<typeof AwaitSchema>; |
| 98 | 98 | |
| 99 | 99 | export const BaseSchema = z.object({ |
| 100 | 100 | "base": z.number().int(), |
| 101 | -}); | |
| 101 | +}).strict(); | |
| 102 | 102 | export type Base = z.infer<typeof BaseSchema>; |
| 103 | 103 | |
| 104 | 104 | export const BitandSchema = z.object({ |
| 105 | 105 | "bitand": z.number().int(), |
| 106 | -}); | |
| 106 | +}).strict(); | |
| 107 | 107 | export type Bitand = z.infer<typeof BitandSchema>; |
| 108 | 108 | |
| 109 | 109 | export const BitorSchema = z.object({ |
| 110 | 110 | "bitor": z.number().int(), |
| 111 | -}); | |
| 111 | +}).strict(); | |
| 112 | 112 | export type Bitor = z.infer<typeof BitorSchema>; |
| 113 | 113 | |
| 114 | 114 | export const BoolSchema = z.object({ |
| 115 | 115 | "BOOL": z.number().int(), |
| 116 | -}); | |
| 116 | +}).strict(); | |
| 117 | 117 | export type Bool = z.infer<typeof BoolSchema>; |
| 118 | 118 | |
| 119 | 119 | export const BooleanSchema = z.object({ |
| 120 | 120 | "boolean": z.number().int(), |
| 121 | -}); | |
| 121 | +}).strict(); | |
| 122 | 122 | export type Boolean = z.infer<typeof BooleanSchema>; |
| 123 | 123 | |
| 124 | 124 | export const BreakSchema = z.object({ |
| 125 | 125 | "break": z.number().int(), |
| 126 | -}); | |
| 126 | +}).strict(); | |
| 127 | 127 | export type Break = z.infer<typeof BreakSchema>; |
| 128 | 128 | |
| 129 | 129 | export const BycopySchema = z.object({ |
| 130 | 130 | "bycopy": z.number().int(), |
| 131 | -}); | |
| 131 | +}).strict(); | |
| 132 | 132 | export type Bycopy = z.infer<typeof BycopySchema>; |
| 133 | 133 | |
| 134 | 134 | export const ByrefSchema = z.object({ |
| 135 | 135 | "byref": z.number().int(), |
| 136 | -}); | |
| 136 | +}).strict(); | |
| 137 | 137 | export type Byref = z.infer<typeof ByrefSchema>; |
| 138 | 138 | |
| 139 | 139 | export const ByteSchema = z.object({ |
| 140 | 140 | "byte": z.number().int(), |
| 141 | -}); | |
| 141 | +}).strict(); | |
| 142 | 142 | export type Byte = z.infer<typeof ByteSchema>; |
| 143 | 143 | |
| 144 | 144 | export const CaseSchema = z.object({ |
| 145 | 145 | "case": z.number().int(), |
| 146 | -}); | |
| 146 | +}).strict(); | |
| 147 | 147 | export type Case = z.infer<typeof CaseSchema>; |
| 148 | 148 | |
| 149 | 149 | export const CatchSchema = z.object({ |
| 150 | 150 | "catch": z.number().int(), |
| 151 | -}); | |
| 151 | +}).strict(); | |
| 152 | 152 | export type Catch = z.infer<typeof CatchSchema>; |
| 153 | 153 | |
| 154 | 154 | export const ChanSchema = z.object({ |
| 155 | 155 | "chan": z.number().int(), |
| 156 | -}); | |
| 156 | +}).strict(); | |
| 157 | 157 | export type Chan = z.infer<typeof ChanSchema>; |
| 158 | 158 | |
| 159 | 159 | export const CharSchema = z.object({ |
| 160 | 160 | "char": z.number().int(), |
| 161 | -}); | |
| 161 | +}).strict(); | |
| 162 | 162 | export type Char = z.infer<typeof CharSchema>; |
| 163 | 163 | |
| 164 | 164 | export const Char16TSchema = z.object({ |
| 165 | 165 | "char16_t": z.number().int(), |
| 166 | -}); | |
| 166 | +}).strict(); | |
| 167 | 167 | export type Char16T = z.infer<typeof Char16TSchema>; |
| 168 | 168 | |
| 169 | 169 | export const Char32TSchema = z.object({ |
| 170 | 170 | "char32_t": z.number().int(), |
| 171 | -}); | |
| 171 | +}).strict(); | |
| 172 | 172 | export type Char32T = z.infer<typeof Char32TSchema>; |
| 173 | 173 | |
| 174 | 174 | export const CheckedSchema = z.object({ |
| 175 | 175 | "checked": z.number().int(), |
| 176 | -}); | |
| 176 | +}).strict(); | |
| 177 | 177 | export type Checked = z.infer<typeof CheckedSchema>; |
| 178 | 178 | |
| 179 | 179 | export const ClassClassSchema = z.object({ |
| 180 | 180 | "Class": z.number().int(), |
| 181 | -}); | |
| 181 | +}).strict(); | |
| 182 | 182 | export type ClassClass = z.infer<typeof ClassClassSchema>; |
| 183 | 183 | |
| 184 | 184 | export const CloneSchema = z.object({ |
| 185 | 185 | "clone": z.number().int(), |
| 186 | -}); | |
| 186 | +}).strict(); | |
| 187 | 187 | export type Clone = z.infer<typeof CloneSchema>; |
| 188 | 188 | |
| 189 | 189 | export const CoAwaitSchema = z.object({ |
| 190 | 190 | "co_await": z.number().int(), |
| 191 | -}); | |
| 191 | +}).strict(); | |
| 192 | 192 | export type CoAwait = z.infer<typeof CoAwaitSchema>; |
| 193 | 193 | |
| 194 | 194 | export const CoReturnSchema = z.object({ |
| 195 | 195 | "co_return": z.number().int(), |
| 196 | -}); | |
| 196 | +}).strict(); | |
| 197 | 197 | export type CoReturn = z.infer<typeof CoReturnSchema>; |
| 198 | 198 | |
| 199 | 199 | export const CoYieldSchema = z.object({ |
| 200 | 200 | "co_yield": z.number().int(), |
| 201 | -}); | |
| 201 | +}).strict(); | |
| 202 | 202 | export type CoYield = z.infer<typeof CoYieldSchema>; |
| 203 | 203 | |
| 204 | 204 | export const ComplSchema = z.object({ |
| 205 | 205 | "compl": z.number().int(), |
| 206 | -}); | |
| 206 | +}).strict(); | |
| 207 | 207 | export type Compl = z.infer<typeof ComplSchema>; |
| 208 | 208 | |
| 209 | 209 | export const ComplexSchema = z.object({ |
| 210 | 210 | "_Complex": z.number().int(), |
| 211 | -}); | |
| 211 | +}).strict(); | |
| 212 | 212 | export type Complex = z.infer<typeof ComplexSchema>; |
| 213 | 213 | |
| 214 | 214 | export const ConceptSchema = z.object({ |
| 215 | 215 | "concept": z.number().int(), |
| 216 | -}); | |
| 216 | +}).strict(); | |
| 217 | 217 | export type Concept = z.infer<typeof ConceptSchema>; |
| 218 | 218 | |
| 219 | 219 | export const ConsoleSchema = z.object({ |
| 220 | 220 | "console": z.number().int(), |
| 221 | -}); | |
| 221 | +}).strict(); | |
| 222 | 222 | export type Console = z.infer<typeof ConsoleSchema>; |
| 223 | 223 | |
| 224 | 224 | export const ConstSchema = z.object({ |
| 225 | 225 | "const": z.number().int(), |
| 226 | -}); | |
| 226 | +}).strict(); | |
| 227 | 227 | export type Const = z.infer<typeof ConstSchema>; |
| 228 | 228 | |
| 229 | 229 | export const ConstCastSchema = z.object({ |
| 230 | 230 | "const_cast": z.number().int(), |
| 231 | -}); | |
| 231 | +}).strict(); | |
| 232 | 232 | export type ConstCast = z.infer<typeof ConstCastSchema>; |
| 233 | 233 | |
| 234 | 234 | export const ConstexprSchema = z.object({ |
| 235 | 235 | "constexpr": z.number().int(), |
| 236 | -}); | |
| 236 | +}).strict(); | |
| 237 | 237 | export type Constexpr = z.infer<typeof ConstexprSchema>; |
| 238 | 238 | |
| 239 | 239 | export const ConstructorSchema = z.object({ |
| 240 | 240 | "constructor": z.number().int(), |
| 241 | -}); | |
| 241 | +}).strict(); | |
| 242 | 242 | export type Constructor = z.infer<typeof ConstructorSchema>; |
| 243 | 243 | |
| 244 | 244 | export const ContinueSchema = z.object({ |
| 245 | 245 | "continue": z.number().int(), |
| 246 | -}); | |
| 246 | +}).strict(); | |
| 247 | 247 | export type Continue = z.infer<typeof ContinueSchema>; |
| 248 | 248 | |
| 249 | 249 | export const ConvenienceSchema = z.object({ |
| 250 | 250 | "convenience": z.number().int(), |
| 251 | -}); | |
| 251 | +}).strict(); | |
| 252 | 252 | export type Convenience = z.infer<typeof ConvenienceSchema>; |
| 253 | 253 | |
| 254 | 254 | export const ConvertSchema = z.object({ |
| 255 | 255 | "convert": z.number().int(), |
| 256 | -}); | |
| 256 | +}).strict(); | |
| 257 | 257 | export type Convert = z.infer<typeof ConvertSchema>; |
| 258 | 258 | |
| 259 | 259 | export const ConverterSchema = z.object({ |
| 260 | 260 | "converter": z.number().int(), |
| 261 | -}); | |
| 261 | +}).strict(); | |
| 262 | 262 | export type Converter = z.infer<typeof ConverterSchema>; |
| 263 | 263 | |
| 264 | 264 | export const DateClassSchema = z.object({ |
| 265 | 265 | "date": z.number().int(), |
| 266 | -}); | |
| 266 | +}).strict(); | |
| 267 | 267 | export type DateClass = z.infer<typeof DateClassSchema>; |
| 268 | 268 | |
| 269 | 269 | export const DateParseHandlingSchema = z.object({ |
| 270 | 270 | "date_parse_handling": z.number().int(), |
| 271 | -}); | |
| 271 | +}).strict(); | |
| 272 | 272 | export type DateParseHandling = z.infer<typeof DateParseHandlingSchema>; |
| 273 | 273 | |
| 274 | 274 | export const DebuggerSchema = z.object({ |
| 275 | 275 | "debugger": z.number().int(), |
| 276 | -}); | |
| 276 | +}).strict(); | |
| 277 | 277 | export type Debugger = z.infer<typeof DebuggerSchema>; |
| 278 | 278 | |
| 279 | 279 | export const DecimalSchema = z.object({ |
| 280 | 280 | "decimal": z.number().int(), |
| 281 | -}); | |
| 281 | +}).strict(); | |
| 282 | 282 | export type Decimal = z.infer<typeof DecimalSchema>; |
| 283 | 283 | |
| 284 | 284 | export const DeclareSchema = z.object({ |
| 285 | 285 | "declare": z.number().int(), |
| 286 | -}); | |
| 286 | +}).strict(); | |
| 287 | 287 | export type Declare = z.infer<typeof DeclareSchema>; |
| 288 | 288 | |
| 289 | 289 | export const DecltypeSchema = z.object({ |
| 290 | 290 | "decltype": z.number().int(), |
| 291 | -}); | |
| 291 | +}).strict(); | |
| 292 | 292 | export type Decltype = z.infer<typeof DecltypeSchema>; |
| 293 | 293 | |
| 294 | 294 | export const DecodeStringSchema = z.object({ |
| 295 | 295 | "decode_string": z.number().int(), |
| 296 | -}); | |
| 296 | +}).strict(); | |
| 297 | 297 | export type DecodeString = z.infer<typeof DecodeStringSchema>; |
| 298 | 298 | |
| 299 | 299 | export const EmptySchema = z.object({ |
| 300 | 300 | "_": z.number().int(), |
| 301 | -}); | |
| 301 | +}).strict(); | |
| 302 | 302 | export type Empty = z.infer<typeof EmptySchema>; |
| 303 | 303 | |
| 304 | 304 | export const ImaginerySchema = z.object({ |
| 305 | 305 | "_Imaginery": z.number().int(), |
| 306 | -}); | |
| 306 | +}).strict(); | |
| 307 | 307 | export type Imaginery = z.infer<typeof ImaginerySchema>; |
| 308 | 308 | |
| 309 | 309 | export const AnyClassSchema = z.object({ |
| 310 | 310 | "any": z.number().int(), |
| 311 | -}); | |
| 311 | +}).strict(); | |
| 312 | 312 | export type AnyClass = z.infer<typeof AnyClassSchema>; |
| 313 | 313 | |
| 314 | 314 | export const BoolClassSchema = z.object({ |
| 315 | 315 | "_Bool": z.number().int(), |
| 316 | -}); | |
| 316 | +}).strict(); | |
| 317 | 317 | export type BoolClass = z.infer<typeof BoolClassSchema>; |
| 318 | 318 | |
| 319 | 319 | export const Obj1ClassSchema = z.object({ |
| 320 | 320 | "class": z.number().int(), |
| 321 | -}); | |
| 321 | +}).strict(); | |
| 322 | 322 | export type Obj1Class = z.infer<typeof Obj1ClassSchema>; |
| 323 | 323 | |
| 324 | 324 | export const Obj1BoolSchema = z.object({ |
| 325 | 325 | "bool": z.number().int(), |
| 326 | -}); | |
| 326 | +}).strict(); | |
| 327 | 327 | export type Obj1Bool = z.infer<typeof Obj1BoolSchema>; |
| 328 | 328 | |
| 329 | 329 | export const DefSchema = z.object({ |
| 330 | 330 | "def": z.number().int(), |
| 331 | -}); | |
| 331 | +}).strict(); | |
| 332 | 332 | export type Def = z.infer<typeof DefSchema>; |
| 333 | 333 | |
| 334 | 334 | export const DefaultSchema = z.object({ |
| 335 | 335 | "default": z.number().int(), |
| 336 | -}); | |
| 336 | +}).strict(); | |
| 337 | 337 | export type Default = z.infer<typeof DefaultSchema>; |
| 338 | 338 | |
| 339 | 339 | export const DeferSchema = z.object({ |
| 340 | 340 | "defer": z.number().int(), |
| 341 | -}); | |
| 341 | +}).strict(); | |
| 342 | 342 | export type Defer = z.infer<typeof DeferSchema>; |
| 343 | 343 | |
| 344 | 344 | export const DeinitSchema = z.object({ |
| 345 | 345 | "deinit": z.number().int(), |
| 346 | -}); | |
| 346 | +}).strict(); | |
| 347 | 347 | export type Deinit = z.infer<typeof DeinitSchema>; |
| 348 | 348 | |
| 349 | 349 | export const DelSchema = z.object({ |
| 350 | 350 | "del": z.number().int(), |
| 351 | -}); | |
| 351 | +}).strict(); | |
| 352 | 352 | export type Del = z.infer<typeof DelSchema>; |
| 353 | 353 | |
| 354 | 354 | export const DelegateSchema = z.object({ |
| 355 | 355 | "delegate": z.number().int(), |
| 356 | -}); | |
| 356 | +}).strict(); | |
| 357 | 357 | export type Delegate = z.infer<typeof DelegateSchema>; |
| 358 | 358 | |
| 359 | 359 | export const DeleteSchema = z.object({ |
| 360 | 360 | "delete": z.number().int(), |
| 361 | -}); | |
| 361 | +}).strict(); | |
| 362 | 362 | export type Delete = z.infer<typeof DeleteSchema>; |
| 363 | 363 | |
| 364 | 364 | export const DictSchema = z.object({ |
| 365 | 365 | "dict": z.number().int(), |
| 366 | -}); | |
| 366 | +}).strict(); | |
| 367 | 367 | export type Dict = z.infer<typeof DictSchema>; |
| 368 | 368 | |
| 369 | 369 | export const DictionarySchema = z.object({ |
| 370 | 370 | "dictionary": z.number().int(), |
| 371 | -}); | |
| 371 | +}).strict(); | |
| 372 | 372 | export type Dictionary = z.infer<typeof DictionarySchema>; |
| 373 | 373 | |
| 374 | 374 | export const DidSetSchema = z.object({ |
| 375 | 375 | "didSet": z.number().int(), |
| 376 | -}); | |
| 376 | +}).strict(); | |
| 377 | 377 | export type DidSet = z.infer<typeof DidSetSchema>; |
| 378 | 378 | |
| 379 | 379 | export const DoSchema = z.object({ |
| 380 | 380 | "do": z.number().int(), |
| 381 | -}); | |
| 381 | +}).strict(); | |
| 382 | 382 | export type Do = z.infer<typeof DoSchema>; |
| 383 | 383 | |
| 384 | 384 | export const DoubleSchema = z.object({ |
| 385 | 385 | "double": z.number().int(), |
| 386 | -}); | |
| 386 | +}).strict(); | |
| 387 | 387 | export type Double = z.infer<typeof DoubleSchema>; |
| 388 | 388 | |
| 389 | 389 | export const DynamicSchema = z.object({ |
| 390 | 390 | "dynamic": z.number().int(), |
| 391 | -}); | |
| 391 | +}).strict(); | |
| 392 | 392 | export type Dynamic = z.infer<typeof DynamicSchema>; |
| 393 | 393 | |
| 394 | 394 | export const DynamicCastSchema = z.object({ |
| 395 | 395 | "dynamic_cast": z.number().int(), |
| 396 | -}); | |
| 396 | +}).strict(); | |
| 397 | 397 | export type DynamicCast = z.infer<typeof DynamicCastSchema>; |
| 398 | 398 | |
| 399 | 399 | export const ElifSchema = z.object({ |
| 400 | 400 | "elif": z.number().int(), |
| 401 | -}); | |
| 401 | +}).strict(); | |
| 402 | 402 | export type Elif = z.infer<typeof ElifSchema>; |
| 403 | 403 | |
| 404 | 404 | export const ElseSchema = z.object({ |
| 405 | 405 | "else": z.number().int(), |
| 406 | -}); | |
| 406 | +}).strict(); | |
| 407 | 407 | export type Else = z.infer<typeof ElseSchema>; |
| 408 | 408 | |
| 409 | 409 | export const EncodeQuickTypeSchema = z.object({ |
| 410 | 410 | "encode_quick_type": z.number().int(), |
| 411 | -}); | |
| 411 | +}).strict(); | |
| 412 | 412 | export type EncodeQuickType = z.infer<typeof EncodeQuickTypeSchema>; |
| 413 | 413 | |
| 414 | 414 | export const EnumSchema = z.object({ |
| 415 | 415 | "enum": z.number().int(), |
| 416 | -}); | |
| 416 | +}).strict(); | |
| 417 | 417 | export type Enum = z.infer<typeof EnumSchema>; |
| 418 | 418 | |
| 419 | 419 | export const EqualityContractSchema = z.object({ |
| 420 | 420 | "equalityContract": z.number().int(), |
| 421 | -}); | |
| 421 | +}).strict(); | |
| 422 | 422 | export type EqualityContract = z.infer<typeof EqualityContractSchema>; |
| 423 | 423 | |
| 424 | 424 | export const EventSchema = z.object({ |
| 425 | 425 | "event": z.number().int(), |
| 426 | -}); | |
| 426 | +}).strict(); | |
| 427 | 427 | export type Event = z.infer<typeof EventSchema>; |
| 428 | 428 | |
| 429 | 429 | export const ExceptSchema = z.object({ |
| 430 | 430 | "except": z.number().int(), |
| 431 | -}); | |
| 431 | +}).strict(); | |
| 432 | 432 | export type Except = z.infer<typeof ExceptSchema>; |
| 433 | 433 | |
| 434 | 434 | export const ExceptionSchema = z.object({ |
| 435 | 435 | "exception": z.number().int(), |
| 436 | -}); | |
| 436 | +}).strict(); | |
| 437 | 437 | export type Exception = z.infer<typeof ExceptionSchema>; |
| 438 | 438 | |
| 439 | 439 | export const ExplicitSchema = z.object({ |
| 440 | 440 | "explicit": z.number().int(), |
| 441 | -}); | |
| 441 | +}).strict(); | |
| 442 | 442 | export type Explicit = z.infer<typeof ExplicitSchema>; |
| 443 | 443 | |
| 444 | 444 | export const ExportSchema = z.object({ |
| 445 | 445 | "export": z.number().int(), |
| 446 | -}); | |
| 446 | +}).strict(); | |
| 447 | 447 | export type Export = z.infer<typeof ExportSchema>; |
| 448 | 448 | |
| 449 | 449 | export const ExposingSchema = z.object({ |
| 450 | 450 | "exposing": z.number().int(), |
| 451 | -}); | |
| 451 | +}).strict(); | |
| 452 | 452 | export type Exposing = z.infer<typeof ExposingSchema>; |
| 453 | 453 | |
| 454 | 454 | export const ExtendsSchema = z.object({ |
| 455 | 455 | "extends": z.number().int(), |
| 456 | -}); | |
| 456 | +}).strict(); | |
| 457 | 457 | export type Extends = z.infer<typeof ExtendsSchema>; |
| 458 | 458 | |
| 459 | 459 | export const ExtensionSchema = z.object({ |
| 460 | 460 | "extension": z.number().int(), |
| 461 | -}); | |
| 461 | +}).strict(); | |
| 462 | 462 | export type Extension = z.infer<typeof ExtensionSchema>; |
| 463 | 463 | |
| 464 | 464 | export const ExternSchema = z.object({ |
| 465 | 465 | "extern": z.number().int(), |
| 466 | -}); | |
| 466 | +}).strict(); | |
| 467 | 467 | export type Extern = z.infer<typeof ExternSchema>; |
| 468 | 468 | |
| 469 | 469 | export const FallthroughSchema = z.object({ |
| 470 | 470 | "fallthrough": z.number().int(), |
| 471 | -}); | |
| 471 | +}).strict(); | |
| 472 | 472 | export type Fallthrough = z.infer<typeof FallthroughSchema>; |
| 473 | 473 | |
| 474 | 474 | export const FalseSchema = z.object({ |
| 475 | 475 | "False": z.number().int(), |
| 476 | -}); | |
| 476 | +}).strict(); | |
| 477 | 477 | export type False = z.infer<typeof FalseSchema>; |
| 478 | 478 | |
| 479 | 479 | export const FileprivateSchema = z.object({ |
| 480 | 480 | "fileprivate": z.number().int(), |
| 481 | -}); | |
| 481 | +}).strict(); | |
| 482 | 482 | export type Fileprivate = z.infer<typeof FileprivateSchema>; |
| 483 | 483 | |
| 484 | 484 | export const FinalSchema = z.object({ |
| 485 | 485 | "final": z.number().int(), |
| 486 | -}); | |
| 486 | +}).strict(); | |
| 487 | 487 | export type Final = z.infer<typeof FinalSchema>; |
| 488 | 488 | |
| 489 | 489 | export const FinallySchema = z.object({ |
| 490 | 490 | "finally": z.number().int(), |
| 491 | -}); | |
| 491 | +}).strict(); | |
| 492 | 492 | export type Finally = z.infer<typeof FinallySchema>; |
| 493 | 493 | |
| 494 | 494 | export const FixedSchema = z.object({ |
| 495 | 495 | "fixed": z.number().int(), |
| 496 | -}); | |
| 496 | +}).strict(); | |
| 497 | 497 | export type Fixed = z.infer<typeof FixedSchema>; |
| 498 | 498 | |
| 499 | 499 | export const FloatSchema = z.object({ |
| 500 | 500 | "float": z.number().int(), |
| 501 | -}); | |
| 501 | +}).strict(); | |
| 502 | 502 | export type Float = z.infer<typeof FloatSchema>; |
| 503 | 503 | |
| 504 | 504 | export const ForSchema = z.object({ |
| 505 | 505 | "for": z.number().int(), |
| 506 | -}); | |
| 506 | +}).strict(); | |
| 507 | 507 | export type For = z.infer<typeof ForSchema>; |
| 508 | 508 | |
| 509 | 509 | export const ForeachSchema = z.object({ |
| 510 | 510 | "foreach": z.number().int(), |
| 511 | -}); | |
| 511 | +}).strict(); | |
| 512 | 512 | export type Foreach = z.infer<typeof ForeachSchema>; |
| 513 | 513 | |
| 514 | 514 | export const FriendSchema = z.object({ |
| 515 | 515 | "friend": z.number().int(), |
| 516 | -}); | |
| 516 | +}).strict(); | |
| 517 | 517 | export type Friend = z.infer<typeof FriendSchema>; |
| 518 | 518 | |
| 519 | 519 | export const FromSchema = z.object({ |
| 520 | 520 | "from": z.number().int(), |
| 521 | -}); | |
| 521 | +}).strict(); | |
| 522 | 522 | export type From = z.infer<typeof FromSchema>; |
| 523 | 523 | |
| 524 | 524 | export const FromJsonSchema = z.object({ |
| 525 | 525 | "from_json": z.number().int(), |
| 526 | -}); | |
| 526 | +}).strict(); | |
| 527 | 527 | export type FromJson = z.infer<typeof FromJsonSchema>; |
| 528 | 528 | |
| 529 | 529 | export const FuncSchema = z.object({ |
| 530 | 530 | "func": z.number().int(), |
| 531 | -}); | |
| 531 | +}).strict(); | |
| 532 | 532 | export type Func = z.infer<typeof FuncSchema>; |
| 533 | 533 | |
| 534 | 534 | export const FunctionSchema = z.object({ |
| 535 | 535 | "function": z.number().int(), |
| 536 | -}); | |
| 536 | +}).strict(); | |
| 537 | 537 | export type Function = z.infer<typeof FunctionSchema>; |
| 538 | 538 | |
| 539 | 539 | export const GetSchema = z.object({ |
| 540 | 540 | "get": z.number().int(), |
| 541 | -}); | |
| 541 | +}).strict(); | |
| 542 | 542 | export type Get = z.infer<typeof GetSchema>; |
| 543 | 543 | |
| 544 | 544 | export const GlobalSchema = z.object({ |
| 545 | 545 | "global": z.number().int(), |
| 546 | -}); | |
| 546 | +}).strict(); | |
| 547 | 547 | export type Global = z.infer<typeof GlobalSchema>; |
| 548 | 548 | |
| 549 | 549 | export const GoSchema = z.object({ |
| 550 | 550 | "go": z.number().int(), |
| 551 | -}); | |
| 551 | +}).strict(); | |
| 552 | 552 | export type Go = z.infer<typeof GoSchema>; |
| 553 | 553 | |
| 554 | 554 | export const GotoSchema = z.object({ |
| 555 | 555 | "goto": z.number().int(), |
| 556 | -}); | |
| 556 | +}).strict(); | |
| 557 | 557 | export type Goto = z.infer<typeof GotoSchema>; |
| 558 | 558 | |
| 559 | 559 | export const GuardSchema = z.object({ |
| 560 | 560 | "guard": z.number().int(), |
| 561 | -}); | |
| 561 | +}).strict(); | |
| 562 | 562 | export type Guard = z.infer<typeof GuardSchema>; |
| 563 | 563 | |
| 564 | 564 | export const HasOwnPropertySchema = z.object({ |
| 565 | 565 | "hasOwnProperty": z.number().int(), |
| 566 | -}); | |
| 566 | +}).strict(); | |
| 567 | 567 | export type HasOwnProperty = z.infer<typeof HasOwnPropertySchema>; |
| 568 | 568 | |
| 569 | 569 | export const IdSchema = z.object({ |
| 570 | 570 | "id": z.number().int(), |
| 571 | -}); | |
| 571 | +}).strict(); | |
| 572 | 572 | export type Id = z.infer<typeof IdSchema>; |
| 573 | 573 | |
| 574 | 574 | export const IfSchema = z.object({ |
| 575 | 575 | "if": z.number().int(), |
| 576 | -}); | |
| 576 | +}).strict(); | |
| 577 | 577 | export type If = z.infer<typeof IfSchema>; |
| 578 | 578 | |
| 579 | 579 | export const ImpSchema = z.object({ |
| 580 | 580 | "IMP": z.number().int(), |
| 581 | -}); | |
| 581 | +}).strict(); | |
| 582 | 582 | export type Imp = z.infer<typeof ImpSchema>; |
| 583 | 583 | |
| 584 | 584 | export const ImplementsSchema = z.object({ |
| 585 | 585 | "implements": z.number().int(), |
| 586 | -}); | |
| 586 | +}).strict(); | |
| 587 | 587 | export type Implements = z.infer<typeof ImplementsSchema>; |
| 588 | 588 | |
| 589 | 589 | export const ImplicitSchema = z.object({ |
| 590 | 590 | "implicit": z.number().int(), |
| 591 | -}); | |
| 591 | +}).strict(); | |
| 592 | 592 | export type Implicit = z.infer<typeof ImplicitSchema>; |
| 593 | 593 | |
| 594 | 594 | export const ImportSchema = z.object({ |
| 595 | 595 | "import": z.number().int(), |
| 596 | -}); | |
| 596 | +}).strict(); | |
| 597 | 597 | export type Import = z.infer<typeof ImportSchema>; |
| 598 | 598 | |
| 599 | 599 | export const InSchema = z.object({ |
| 600 | 600 | "in": z.number().int(), |
| 601 | -}); | |
| 601 | +}).strict(); | |
| 602 | 602 | export type In = z.infer<typeof InSchema>; |
| 603 | 603 | |
| 604 | 604 | export const IndirectSchema = z.object({ |
| 605 | 605 | "indirect": z.number().int(), |
| 606 | -}); | |
| 606 | +}).strict(); | |
| 607 | 607 | export type Indirect = z.infer<typeof IndirectSchema>; |
| 608 | 608 | |
| 609 | 609 | export const InfixSchema = z.object({ |
| 610 | 610 | "infix": z.number().int(), |
| 611 | -}); | |
| 611 | +}).strict(); | |
| 612 | 612 | export type Infix = z.infer<typeof InfixSchema>; |
| 613 | 613 | |
| 614 | 614 | export const InitSchema = z.object({ |
| 615 | 615 | "init": z.number().int(), |
| 616 | -}); | |
| 616 | +}).strict(); | |
| 617 | 617 | export type Init = z.infer<typeof InitSchema>; |
| 618 | 618 | |
| 619 | 619 | export const InlineSchema = z.object({ |
| 620 | 620 | "inline": z.number().int(), |
| 621 | -}); | |
| 621 | +}).strict(); | |
| 622 | 622 | export type Inline = z.infer<typeof InlineSchema>; |
| 623 | 623 | |
| 624 | 624 | export const InoutSchema = z.object({ |
| 625 | 625 | "inout": z.number().int(), |
| 626 | -}); | |
| 626 | +}).strict(); | |
| 627 | 627 | export type Inout = z.infer<typeof InoutSchema>; |
| 628 | 628 | |
| 629 | 629 | export const InstanceofSchema = z.object({ |
| 630 | 630 | "instanceof": z.number().int(), |
| 631 | -}); | |
| 631 | +}).strict(); | |
| 632 | 632 | export type Instanceof = z.infer<typeof InstanceofSchema>; |
| 633 | 633 | |
| 634 | 634 | export const IntSchema = z.object({ |
| 635 | 635 | "int": z.number().int(), |
| 636 | -}); | |
| 636 | +}).strict(); | |
| 637 | 637 | export type Int = z.infer<typeof IntSchema>; |
| 638 | 638 | |
| 639 | 639 | export const InterfaceSchema = z.object({ |
| 640 | 640 | "interface": z.number().int(), |
| 641 | -}); | |
| 641 | +}).strict(); | |
| 642 | 642 | export type Interface = z.infer<typeof InterfaceSchema>; |
| 643 | 643 | |
| 644 | 644 | export const InternalSchema = z.object({ |
| 645 | 645 | "internal": z.number().int(), |
| 646 | -}); | |
| 646 | +}).strict(); | |
| 647 | 647 | export type Internal = z.infer<typeof InternalSchema>; |
| 648 | 648 | |
| 649 | 649 | export const FalseClassSchema = z.object({ |
| 650 | 650 | "false": z.number().int(), |
| 651 | -}); | |
| 651 | +}).strict(); | |
| 652 | 652 | export type FalseClass = z.infer<typeof FalseClassSchema>; |
| 653 | 653 | |
| 654 | 654 | export const IsSchema = z.object({ |
| 655 | 655 | "is": z.number().int(), |
| 656 | -}); | |
| 656 | +}).strict(); | |
| 657 | 657 | export type Is = z.infer<typeof IsSchema>; |
| 658 | 658 | |
| 659 | 659 | export const IterableSchema = z.object({ |
| 660 | 660 | "iterable": z.number().int(), |
| 661 | -}); | |
| 661 | +}).strict(); | |
| 662 | 662 | export type Iterable = z.infer<typeof IterableSchema>; |
| 663 | 663 | |
| 664 | 664 | export const JdecSchema = z.object({ |
| 665 | 665 | "jdec": z.number().int(), |
| 666 | -}); | |
| 666 | +}).strict(); | |
| 667 | 667 | export type Jdec = z.infer<typeof JdecSchema>; |
| 668 | 668 | |
| 669 | 669 | export const JencSchema = z.object({ |
| 670 | 670 | "jenc": z.number().int(), |
| 671 | -}); | |
| 671 | +}).strict(); | |
| 672 | 672 | export type Jenc = z.infer<typeof JencSchema>; |
| 673 | 673 | |
| 674 | 674 | export const JpipeSchema = z.object({ |
| 675 | 675 | "jpipe": z.number().int(), |
| 676 | -}); | |
| 676 | +}).strict(); | |
| 677 | 677 | export type Jpipe = z.infer<typeof JpipeSchema>; |
| 678 | 678 | |
| 679 | 679 | export const JsonSchema = z.object({ |
| 680 | 680 | "json": z.number().int(), |
| 681 | -}); | |
| 681 | +}).strict(); | |
| 682 | 682 | export type Json = z.infer<typeof JsonSchema>; |
| 683 | 683 | |
| 684 | 684 | export const JsonConverterSchema = z.object({ |
| 685 | 685 | "json_converter": z.number().int(), |
| 686 | -}); | |
| 686 | +}).strict(); | |
| 687 | 687 | export type JsonConverter = z.infer<typeof JsonConverterSchema>; |
| 688 | 688 | |
| 689 | 689 | export const JsonSerializerSchema = z.object({ |
| 690 | 690 | "json_serializer": z.number().int(), |
| 691 | -}); | |
| 691 | +}).strict(); | |
| 692 | 692 | export type JsonSerializer = z.infer<typeof JsonSerializerSchema>; |
| 693 | 693 | |
| 694 | 694 | export const JsonTokenSchema = z.object({ |
| 695 | 695 | "json_token": z.number().int(), |
| 696 | -}); | |
| 696 | +}).strict(); | |
| 697 | 697 | export type JsonToken = z.infer<typeof JsonTokenSchema>; |
| 698 | 698 | |
| 699 | 699 | export const JsonWriterSchema = z.object({ |
| 700 | 700 | "json_writer": z.number().int(), |
| 701 | -}); | |
| 701 | +}).strict(); | |
| 702 | 702 | export type JsonWriter = z.infer<typeof JsonWriterSchema>; |
| 703 | 703 | |
| 704 | 704 | export const LambdaSchema = z.object({ |
| 705 | 705 | "lambda": z.number().int(), |
| 706 | -}); | |
| 706 | +}).strict(); | |
| 707 | 707 | export type Lambda = z.infer<typeof LambdaSchema>; |
| 708 | 708 | |
| 709 | 709 | export const LazySchema = z.object({ |
| 710 | 710 | "lazy": z.number().int(), |
| 711 | -}); | |
| 711 | +}).strict(); | |
| 712 | 712 | export type Lazy = z.infer<typeof LazySchema>; |
| 713 | 713 | |
| 714 | 714 | export const LeftSchema = z.object({ |
| 715 | 715 | "left": z.number().int(), |
| 716 | -}); | |
| 716 | +}).strict(); | |
| 717 | 717 | export type Left = z.infer<typeof LeftSchema>; |
| 718 | 718 | |
| 719 | 719 | export const LetSchema = z.object({ |
| 720 | 720 | "let": z.number().int(), |
| 721 | -}); | |
| 721 | +}).strict(); | |
| 722 | 722 | export type Let = z.infer<typeof LetSchema>; |
| 723 | 723 | |
| 724 | 724 | export const ListSchema = z.object({ |
| 725 | 725 | "list": z.number().int(), |
| 726 | -}); | |
| 726 | +}).strict(); | |
| 727 | 727 | export type List = z.infer<typeof ListSchema>; |
| 728 | 728 | |
| 729 | 729 | export const LockSchema = z.object({ |
| 730 | 730 | "lock": z.number().int(), |
| 731 | -}); | |
| 731 | +}).strict(); | |
| 732 | 732 | export type Lock = z.infer<typeof LockSchema>; |
| 733 | 733 | |
| 734 | 734 | export const LongSchema = z.object({ |
| 735 | 735 | "long": z.number().int(), |
| 736 | -}); | |
| 736 | +}).strict(); | |
| 737 | 737 | export type Long = z.infer<typeof LongSchema>; |
| 738 | 738 | |
| 739 | 739 | export const MapSchema = z.object({ |
| 740 | 740 | "map": z.number().int(), |
| 741 | -}); | |
| 741 | +}).strict(); | |
| 742 | 742 | export type Map = z.infer<typeof MapSchema>; |
| 743 | 743 | |
| 744 | 744 | export const MetadataPropertyHandlingSchema = z.object({ |
| 745 | 745 | "metadata_property_handling": z.number().int(), |
| 746 | -}); | |
| 746 | +}).strict(); | |
| 747 | 747 | export type MetadataPropertyHandling = z.infer<typeof MetadataPropertyHandlingSchema>; |
| 748 | 748 | |
| 749 | 749 | export const ModuleSchema = z.object({ |
| 750 | 750 | "module": z.number().int(), |
| 751 | -}); | |
| 751 | +}).strict(); | |
| 752 | 752 | export type Module = z.infer<typeof ModuleSchema>; |
| 753 | 753 | |
| 754 | 754 | export const MutableSchema = z.object({ |
| 755 | 755 | "mutable": z.number().int(), |
| 756 | -}); | |
| 756 | +}).strict(); | |
| 757 | 757 | export type Mutable = z.infer<typeof MutableSchema>; |
| 758 | 758 | |
| 759 | 759 | export const MutatingSchema = z.object({ |
| 760 | 760 | "mutating": z.number().int(), |
| 761 | -}); | |
| 761 | +}).strict(); | |
| 762 | 762 | export type Mutating = z.infer<typeof MutatingSchema>; |
| 763 | 763 | |
| 764 | 764 | export const NamespaceSchema = z.object({ |
| 765 | 765 | "namespace": z.number().int(), |
| 766 | -}); | |
| 766 | +}).strict(); | |
| 767 | 767 | export type Namespace = z.infer<typeof NamespaceSchema>; |
| 768 | 768 | |
| 769 | 769 | export const NativeSchema = z.object({ |
| 770 | 770 | "native": z.number().int(), |
| 771 | -}); | |
| 771 | +}).strict(); | |
| 772 | 772 | export type Native = z.infer<typeof NativeSchema>; |
| 773 | 773 | |
| 774 | 774 | export const NewSchema = z.object({ |
| 775 | 775 | "new": z.number().int(), |
| 776 | -}); | |
| 776 | +}).strict(); | |
| 777 | 777 | export type New = z.infer<typeof NewSchema>; |
| 778 | 778 | |
| 779 | 779 | export const NewtonsoftSchema = z.object({ |
| 780 | 780 | "newtonsoft": z.number().int(), |
| 781 | -}); | |
| 781 | +}).strict(); | |
| 782 | 782 | export type Newtonsoft = z.infer<typeof NewtonsoftSchema>; |
| 783 | 783 | |
| 784 | 784 | export const NilSchema = z.object({ |
| 785 | 785 | "nil": z.number().int(), |
| 786 | -}); | |
| 786 | +}).strict(); | |
| 787 | 787 | export type Nil = z.infer<typeof NilSchema>; |
| 788 | 788 | |
| 789 | 789 | export const NoSchema = z.object({ |
| 790 | 790 | "NO": z.number().int(), |
| 791 | -}); | |
| 791 | +}).strict(); | |
| 792 | 792 | export type No = z.infer<typeof NoSchema>; |
| 793 | 793 | |
| 794 | 794 | export const NoexceptSchema = z.object({ |
| 795 | 795 | "noexcept": z.number().int(), |
| 796 | -}); | |
| 796 | +}).strict(); | |
| 797 | 797 | export type Noexcept = z.infer<typeof NoexceptSchema>; |
| 798 | 798 | |
| 799 | 799 | export const NonatomicSchema = z.object({ |
| 800 | 800 | "nonatomic": z.number().int(), |
| 801 | -}); | |
| 801 | +}).strict(); | |
| 802 | 802 | export type Nonatomic = z.infer<typeof NonatomicSchema>; |
| 803 | 803 | |
| 804 | 804 | export const NoneSchema = z.object({ |
| 805 | 805 | "None": z.number().int(), |
| 806 | -}); | |
| 806 | +}).strict(); | |
| 807 | 807 | export type None = z.infer<typeof NoneSchema>; |
| 808 | 808 | |
| 809 | 809 | export const NonlocalSchema = z.object({ |
| 810 | 810 | "nonlocal": z.number().int(), |
| 811 | -}); | |
| 811 | +}).strict(); | |
| 812 | 812 | export type Nonlocal = z.infer<typeof NonlocalSchema>; |
| 813 | 813 | |
| 814 | 814 | export const NonmutatingSchema = z.object({ |
| 815 | 815 | "nonmutating": z.number().int(), |
| 816 | -}); | |
| 816 | +}).strict(); | |
| 817 | 817 | export type Nonmutating = z.infer<typeof NonmutatingSchema>; |
| 818 | 818 | |
| 819 | 819 | export const NotSchema = z.object({ |
| 820 | 820 | "not": z.number().int(), |
| 821 | -}); | |
| 821 | +}).strict(); | |
| 822 | 822 | export type Not = z.infer<typeof NotSchema>; |
| 823 | 823 | |
| 824 | 824 | export const NotEqSchema = z.object({ |
| 825 | 825 | "not_eq": z.number().int(), |
| 826 | -}); | |
| 826 | +}).strict(); | |
| 827 | 827 | export type NotEq = z.infer<typeof NotEqSchema>; |
| 828 | 828 | |
| 829 | 829 | export const NsStringSchema = z.object({ |
| 830 | 830 | "NSString": z.number().int(), |
| 831 | -}); | |
| 831 | +}).strict(); | |
| 832 | 832 | export type NsString = z.infer<typeof NsStringSchema>; |
| 833 | 833 | |
| 834 | 834 | export const NullSchema = z.object({ |
| 835 | 835 | "NULL": z.number().int(), |
| 836 | -}); | |
| 836 | +}).strict(); | |
| 837 | 837 | export type Null = z.infer<typeof NullSchema>; |
| 838 | 838 | |
| 839 | 839 | export const NullptrSchema = z.object({ |
| 840 | 840 | "nullptr": z.number().int(), |
| 841 | -}); | |
| 841 | +}).strict(); | |
| 842 | 842 | export type Nullptr = z.infer<typeof NullptrSchema>; |
| 843 | 843 | |
| 844 | 844 | export const NumberSchema = z.object({ |
| 845 | 845 | "number": z.number().int(), |
| 846 | -}); | |
| 846 | +}).strict(); | |
| 847 | 847 | export type Number = z.infer<typeof NumberSchema>; |
| 848 | 848 | |
| 849 | 849 | export const NoneClassSchema = z.object({ |
| 850 | 850 | "none": z.number().int(), |
| 851 | -}); | |
| 851 | +}).strict(); | |
| 852 | 852 | export type NoneClass = z.infer<typeof NoneClassSchema>; |
| 853 | 853 | |
| 854 | 854 | export const NullClassSchema = z.object({ |
| 855 | 855 | "null": z.number().int(), |
| 856 | -}); | |
| 856 | +}).strict(); | |
| 857 | 857 | export type NullClass = z.infer<typeof NullClassSchema>; |
| 858 | 858 | |
| 859 | 859 | export const ProtocolClassSchema = z.object({ |
| 860 | 860 | "protocol": z.number().int(), |
| 861 | -}); | |
| 861 | +}).strict(); | |
| 862 | 862 | export type ProtocolClass = z.infer<typeof ProtocolClassSchema>; |
| 863 | 863 | |
| 864 | 864 | export const ObjectClassSchema = z.object({ |
| 865 | 865 | "object": z.number().int(), |
| 866 | -}); | |
| 866 | +}).strict(); | |
| 867 | 867 | export type ObjectClass = z.infer<typeof ObjectClassSchema>; |
| 868 | 868 | |
| 869 | 869 | export const OfSchema = z.object({ |
| 870 | 870 | "of": z.number().int(), |
| 871 | -}); | |
| 871 | +}).strict(); | |
| 872 | 872 | export type Of = z.infer<typeof OfSchema>; |
| 873 | 873 | |
| 874 | 874 | export const OnewaySchema = z.object({ |
| 875 | 875 | "oneway": z.number().int(), |
| 876 | -}); | |
| 876 | +}).strict(); | |
| 877 | 877 | export type Oneway = z.infer<typeof OnewaySchema>; |
| 878 | 878 | |
| 879 | 879 | export const OpenSchema = z.object({ |
| 880 | 880 | "open": z.number().int(), |
| 881 | -}); | |
| 881 | +}).strict(); | |
| 882 | 882 | export type Open = z.infer<typeof OpenSchema>; |
| 883 | 883 | |
| 884 | 884 | export const OperatorSchema = z.object({ |
| 885 | 885 | "operator": z.number().int(), |
| 886 | -}); | |
| 886 | +}).strict(); | |
| 887 | 887 | export type Operator = z.infer<typeof OperatorSchema>; |
| 888 | 888 | |
| 889 | 889 | export const OptionalSchema = z.object({ |
| 890 | 890 | "optional": z.number().int(), |
| 891 | -}); | |
| 891 | +}).strict(); | |
| 892 | 892 | export type Optional = z.infer<typeof OptionalSchema>; |
| 893 | 893 | |
| 894 | 894 | export const OrSchema = z.object({ |
| 895 | 895 | "or": z.number().int(), |
| 896 | -}); | |
| 896 | +}).strict(); | |
| 897 | 897 | export type Or = z.infer<typeof OrSchema>; |
| 898 | 898 | |
| 899 | 899 | export const OrEqSchema = z.object({ |
| 900 | 900 | "or_eq": z.number().int(), |
| 901 | -}); | |
| 901 | +}).strict(); | |
| 902 | 902 | export type OrEq = z.infer<typeof OrEqSchema>; |
| 903 | 903 | |
| 904 | 904 | export const OutSchema = z.object({ |
| 905 | 905 | "out": z.number().int(), |
| 906 | -}); | |
| 906 | +}).strict(); | |
| 907 | 907 | export type Out = z.infer<typeof OutSchema>; |
| 908 | 908 | |
| 909 | 909 | export const OverrideSchema = z.object({ |
| 910 | 910 | "override": z.number().int(), |
| 911 | -}); | |
| 911 | +}).strict(); | |
| 912 | 912 | export type Override = z.infer<typeof OverrideSchema>; |
| 913 | 913 | |
| 914 | 914 | export const PackageSchema = z.object({ |
| 915 | 915 | "package": z.number().int(), |
| 916 | -}); | |
| 916 | +}).strict(); | |
| 917 | 917 | export type Package = z.infer<typeof PackageSchema>; |
| 918 | 918 | |
| 919 | 919 | export const ParamsSchema = z.object({ |
| 920 | 920 | "params": z.number().int(), |
| 921 | -}); | |
| 921 | +}).strict(); | |
| 922 | 922 | export type Params = z.infer<typeof ParamsSchema>; |
| 923 | 923 | |
| 924 | 924 | export const PassSchema = z.object({ |
| 925 | 925 | "pass": z.number().int(), |
| 926 | -}); | |
| 926 | +}).strict(); | |
| 927 | 927 | export type Pass = z.infer<typeof PassSchema>; |
| 928 | 928 | |
| 929 | 929 | export const PortSchema = z.object({ |
| 930 | 930 | "port": z.number().int(), |
| 931 | -}); | |
| 931 | +}).strict(); | |
| 932 | 932 | export type Port = z.infer<typeof PortSchema>; |
| 933 | 933 | |
| 934 | 934 | export const PostfixSchema = z.object({ |
| 935 | 935 | "postfix": z.number().int(), |
| 936 | -}); | |
| 936 | +}).strict(); | |
| 937 | 937 | export type Postfix = z.infer<typeof PostfixSchema>; |
| 938 | 938 | |
| 939 | 939 | export const PrecedenceSchema = z.object({ |
| 940 | 940 | "precedence": z.number().int(), |
| 941 | -}); | |
| 941 | +}).strict(); | |
| 942 | 942 | export type Precedence = z.infer<typeof PrecedenceSchema>; |
| 943 | 943 | |
| 944 | 944 | export const PrefixSchema = z.object({ |
| 945 | 945 | "prefix": z.number().int(), |
| 946 | -}); | |
| 946 | +}).strict(); | |
| 947 | 947 | export type Prefix = z.infer<typeof PrefixSchema>; |
| 948 | 948 | |
| 949 | 949 | export const PrintSchema = z.object({ |
| 950 | 950 | "print": z.number().int(), |
| 951 | -}); | |
| 951 | +}).strict(); | |
| 952 | 952 | export type Print = z.infer<typeof PrintSchema>; |
| 953 | 953 | |
| 954 | 954 | export const PrintMembersSchema = z.object({ |
| 955 | 955 | "printMembers": z.number().int(), |
| 956 | -}); | |
| 956 | +}).strict(); | |
| 957 | 957 | export type PrintMembers = z.infer<typeof PrintMembersSchema>; |
| 958 | 958 | |
| 959 | 959 | export const PrintfSchema = z.object({ |
| 960 | 960 | "printf": z.number().int(), |
| 961 | -}); | |
| 961 | +}).strict(); | |
| 962 | 962 | export type Printf = z.infer<typeof PrintfSchema>; |
| 963 | 963 | |
| 964 | 964 | export const PrivateSchema = z.object({ |
| 965 | 965 | "private": z.number().int(), |
| 966 | -}); | |
| 966 | +}).strict(); | |
| 967 | 967 | export type Private = z.infer<typeof PrivateSchema>; |
| 968 | 968 | |
| 969 | 969 | export const ProtectedSchema = z.object({ |
| 970 | 970 | "protected": z.number().int(), |
| 971 | -}); | |
| 971 | +}).strict(); | |
| 972 | 972 | export type Protected = z.infer<typeof ProtectedSchema>; |
| 973 | 973 | |
| 974 | 974 | export const ProtocolSchema = z.object({ |
| 975 | 975 | "Protocol": z.number().int(), |
| 976 | -}); | |
| 976 | +}).strict(); | |
| 977 | 977 | export type Protocol = z.infer<typeof ProtocolSchema>; |
| 978 | 978 | |
| 979 | 979 | export const SelfClassSchema = z.object({ |
| 980 | 980 | "self": z.number().int(), |
| 981 | -}); | |
| 981 | +}).strict(); | |
| 982 | 982 | export type SelfClass = z.infer<typeof SelfClassSchema>; |
| 983 | 983 | |
| 984 | 984 | export const TrueClassSchema = z.object({ |
| 985 | 985 | "true": z.number().int(), |
| 986 | -}); | |
| 986 | +}).strict(); | |
| 987 | 987 | export type TrueClass = z.infer<typeof TrueClassSchema>; |
| 988 | 988 | |
| 989 | 989 | export const TypeClassSchema = z.object({ |
| 990 | 990 | "type": z.number().int(), |
| 991 | -}); | |
| 991 | +}).strict(); | |
| 992 | 992 | export type TypeClass = z.infer<typeof TypeClassSchema>; |
| 993 | 993 | |
| 994 | 994 | export const PublicSchema = z.object({ |
| 995 | 995 | "public": z.number().int(), |
| 996 | -}); | |
| 996 | +}).strict(); | |
| 997 | 997 | export type Public = z.infer<typeof PublicSchema>; |
| 998 | 998 | |
| 999 | 999 | export const QuicktypeSchema = z.object({ |
| 1000 | 1000 | "quicktype": z.number().int(), |
| 1001 | -}); | |
| 1001 | +}).strict(); | |
| 1002 | 1002 | export type Quicktype = z.infer<typeof QuicktypeSchema>; |
| 1003 | 1003 | |
| 1004 | 1004 | export const RaiseSchema = z.object({ |
| 1005 | 1005 | "raise": z.number().int(), |
| 1006 | -}); | |
| 1006 | +}).strict(); | |
| 1007 | 1007 | export type Raise = z.infer<typeof RaiseSchema>; |
| 1008 | 1008 | |
| 1009 | 1009 | export const RangeSchema = z.object({ |
| 1010 | 1010 | "range": z.number().int(), |
| 1011 | -}); | |
| 1011 | +}).strict(); | |
| 1012 | 1012 | export type Range = z.infer<typeof RangeSchema>; |
| 1013 | 1013 | |
| 1014 | 1014 | export const ReadonlySchema = z.object({ |
| 1015 | 1015 | "readonly": z.number().int(), |
| 1016 | -}); | |
| 1016 | +}).strict(); | |
| 1017 | 1017 | export type Readonly = z.infer<typeof ReadonlySchema>; |
| 1018 | 1018 | |
| 1019 | 1019 | export const RefSchema = z.object({ |
| 1020 | 1020 | "ref": z.number().int(), |
| 1021 | -}); | |
| 1021 | +}).strict(); | |
| 1022 | 1022 | export type Ref = z.infer<typeof RefSchema>; |
| 1023 | 1023 | |
| 1024 | 1024 | export const RegisterSchema = z.object({ |
| 1025 | 1025 | "register": z.number().int(), |
| 1026 | -}); | |
| 1026 | +}).strict(); | |
| 1027 | 1027 | export type Register = z.infer<typeof RegisterSchema>; |
| 1028 | 1028 | |
| 1029 | 1029 | export const ReinterpretCastSchema = z.object({ |
| 1030 | 1030 | "reinterpret_cast": z.number().int(), |
| 1031 | -}); | |
| 1031 | +}).strict(); | |
| 1032 | 1032 | export type ReinterpretCast = z.infer<typeof ReinterpretCastSchema>; |
| 1033 | 1033 | |
| 1034 | 1034 | export const RepeatSchema = z.object({ |
| 1035 | 1035 | "repeat": z.number().int(), |
| 1036 | -}); | |
| 1036 | +}).strict(); | |
| 1037 | 1037 | export type Repeat = z.infer<typeof RepeatSchema>; |
| 1038 | 1038 | |
| 1039 | 1039 | export const RequireSchema = z.object({ |
| 1040 | 1040 | "require": z.number().int(), |
| 1041 | -}); | |
| 1041 | +}).strict(); | |
| 1042 | 1042 | export type Require = z.infer<typeof RequireSchema>; |
| 1043 | 1043 | |
| 1044 | 1044 | export const RequiredSchema = z.object({ |
| 1045 | 1045 | "required": z.number().int(), |
| 1046 | -}); | |
| 1046 | +}).strict(); | |
| 1047 | 1047 | export type Required = z.infer<typeof RequiredSchema>; |
| 1048 | 1048 | |
| 1049 | 1049 | export const RequiresSchema = z.object({ |
| 1050 | 1050 | "requires": z.number().int(), |
| 1051 | -}); | |
| 1051 | +}).strict(); | |
| 1052 | 1052 | export type Requires = z.infer<typeof RequiresSchema>; |
| 1053 | 1053 | |
| 1054 | 1054 | export const RestrictSchema = z.object({ |
| 1055 | 1055 | "restrict": z.number().int(), |
| 1056 | -}); | |
| 1056 | +}).strict(); | |
| 1057 | 1057 | export type Restrict = z.infer<typeof RestrictSchema>; |
| 1058 | 1058 | |
| 1059 | 1059 | export const RetainSchema = z.object({ |
| 1060 | 1060 | "retain": z.number().int(), |
| 1061 | -}); | |
| 1061 | +}).strict(); | |
| 1062 | 1062 | export type Retain = z.infer<typeof RetainSchema>; |
| 1063 | 1063 | |
| 1064 | 1064 | export const RethrowsSchema = z.object({ |
| 1065 | 1065 | "rethrows": z.number().int(), |
| 1066 | -}); | |
| 1066 | +}).strict(); | |
| 1067 | 1067 | export type Rethrows = z.infer<typeof RethrowsSchema>; |
| 1068 | 1068 | |
| 1069 | 1069 | export const ReturnSchema = z.object({ |
| 1070 | 1070 | "return": z.number().int(), |
| 1071 | -}); | |
| 1071 | +}).strict(); | |
| 1072 | 1072 | export type Return = z.infer<typeof ReturnSchema>; |
| 1073 | 1073 | |
| 1074 | 1074 | export const RightSchema = z.object({ |
| 1075 | 1075 | "right": z.number().int(), |
| 1076 | -}); | |
| 1076 | +}).strict(); | |
| 1077 | 1077 | export type Right = z.infer<typeof RightSchema>; |
| 1078 | 1078 | |
| 1079 | 1079 | export const SbyteSchema = z.object({ |
| 1080 | 1080 | "sbyte": z.number().int(), |
| 1081 | -}); | |
| 1081 | +}).strict(); | |
| 1082 | 1082 | export type Sbyte = z.infer<typeof SbyteSchema>; |
| 1083 | 1083 | |
| 1084 | 1084 | export const SealedSchema = z.object({ |
| 1085 | 1085 | "sealed": z.number().int(), |
| 1086 | -}); | |
| 1086 | +}).strict(); | |
| 1087 | 1087 | export type Sealed = z.infer<typeof SealedSchema>; |
| 1088 | 1088 | |
| 1089 | 1089 | export const SelSchema = z.object({ |
| 1090 | 1090 | "SEL": z.number().int(), |
| 1091 | -}); | |
| 1091 | +}).strict(); | |
| 1092 | 1092 | export type Sel = z.infer<typeof SelSchema>; |
| 1093 | 1093 | |
| 1094 | 1094 | export const SelectSchema = z.object({ |
| 1095 | 1095 | "select": z.number().int(), |
| 1096 | -}); | |
| 1096 | +}).strict(); | |
| 1097 | 1097 | export type Select = z.infer<typeof SelectSchema>; |
| 1098 | 1098 | |
| 1099 | 1099 | export const SelfSchema = z.object({ |
| 1100 | 1100 | "Self": z.number().int(), |
| 1101 | -}); | |
| 1101 | +}).strict(); | |
| 1102 | 1102 | export type Self = z.infer<typeof SelfSchema>; |
| 1103 | 1103 | |
| 1104 | 1104 | export const SerializeSchema = z.object({ |
| 1105 | 1105 | "serialize": z.number().int(), |
| 1106 | -}); | |
| 1106 | +}).strict(); | |
| 1107 | 1107 | export type Serialize = z.infer<typeof SerializeSchema>; |
| 1108 | 1108 | |
| 1109 | 1109 | export const SetSchema = z.object({ |
| 1110 | 1110 | "set": z.number().int(), |
| 1111 | -}); | |
| 1111 | +}).strict(); | |
| 1112 | 1112 | export type Set = z.infer<typeof SetSchema>; |
| 1113 | 1113 | |
| 1114 | 1114 | export const ShortSchema = z.object({ |
| 1115 | 1115 | "short": z.number().int(), |
| 1116 | -}); | |
| 1116 | +}).strict(); | |
| 1117 | 1117 | export type Short = z.infer<typeof ShortSchema>; |
| 1118 | 1118 | |
| 1119 | 1119 | export const SignedSchema = z.object({ |
| 1120 | 1120 | "signed": z.number().int(), |
| 1121 | -}); | |
| 1121 | +}).strict(); | |
| 1122 | 1122 | export type Signed = z.infer<typeof SignedSchema>; |
| 1123 | 1123 | |
| 1124 | 1124 | export const SizeofSchema = z.object({ |
| 1125 | 1125 | "sizeof": z.number().int(), |
| 1126 | -}); | |
| 1126 | +}).strict(); | |
| 1127 | 1127 | export type Sizeof = z.infer<typeof SizeofSchema>; |
| 1128 | 1128 | |
| 1129 | 1129 | export const StackallocSchema = z.object({ |
| 1130 | 1130 | "stackalloc": z.number().int(), |
| 1131 | -}); | |
| 1131 | +}).strict(); | |
| 1132 | 1132 | export type Stackalloc = z.infer<typeof StackallocSchema>; |
| 1133 | 1133 | |
| 1134 | 1134 | export const StaticSchema = z.object({ |
| 1135 | 1135 | "static": z.number().int(), |
| 1136 | -}); | |
| 1136 | +}).strict(); | |
| 1137 | 1137 | export type Static = z.infer<typeof StaticSchema>; |
| 1138 | 1138 | |
| 1139 | 1139 | export const StaticAssertSchema = z.object({ |
| 1140 | 1140 | "static_assert": z.number().int(), |
| 1141 | -}); | |
| 1141 | +}).strict(); | |
| 1142 | 1142 | export type StaticAssert = z.infer<typeof StaticAssertSchema>; |
| 1143 | 1143 | |
| 1144 | 1144 | export const StaticCastSchema = z.object({ |
| 1145 | 1145 | "static_cast": z.number().int(), |
| 1146 | -}); | |
| 1146 | +}).strict(); | |
| 1147 | 1147 | export type StaticCast = z.infer<typeof StaticCastSchema>; |
| 1148 | 1148 | |
| 1149 | 1149 | export const StrictfpSchema = z.object({ |
| 1150 | 1150 | "strictfp": z.number().int(), |
| 1151 | -}); | |
| 1151 | +}).strict(); | |
| 1152 | 1152 | export type Strictfp = z.infer<typeof StrictfpSchema>; |
| 1153 | 1153 | |
| 1154 | 1154 | export const StringClassSchema = z.object({ |
| 1155 | 1155 | "string": z.number().int(), |
| 1156 | -}); | |
| 1156 | +}).strict(); | |
| 1157 | 1157 | export type StringClass = z.infer<typeof StringClassSchema>; |
| 1158 | 1158 | |
| 1159 | 1159 | export const StructSchema = z.object({ |
| 1160 | 1160 | "struct": z.number().int(), |
| 1161 | -}); | |
| 1161 | +}).strict(); | |
| 1162 | 1162 | export type Struct = z.infer<typeof StructSchema>; |
| 1163 | 1163 | |
| 1164 | 1164 | export const SubscriptSchema = z.object({ |
| 1165 | 1165 | "subscript": z.number().int(), |
| 1166 | -}); | |
| 1166 | +}).strict(); | |
| 1167 | 1167 | export type Subscript = z.infer<typeof SubscriptSchema>; |
| 1168 | 1168 | |
| 1169 | 1169 | export const SuperSchema = z.object({ |
| 1170 | 1170 | "super": z.number().int(), |
| 1171 | -}); | |
| 1171 | +}).strict(); | |
| 1172 | 1172 | export type Super = z.infer<typeof SuperSchema>; |
| 1173 | 1173 | |
| 1174 | 1174 | export const SwitchSchema = z.object({ |
| 1175 | 1175 | "switch": z.number().int(), |
| 1176 | -}); | |
| 1176 | +}).strict(); | |
| 1177 | 1177 | export type Switch = z.infer<typeof SwitchSchema>; |
| 1178 | 1178 | |
| 1179 | 1179 | export const SymbolSchema = z.object({ |
| 1180 | 1180 | "symbol": z.number().int(), |
| 1181 | -}); | |
| 1181 | +}).strict(); | |
| 1182 | 1182 | export type Symbol = z.infer<typeof SymbolSchema>; |
| 1183 | 1183 | |
| 1184 | 1184 | export const SynchronizedSchema = z.object({ |
| 1185 | 1185 | "synchronized": z.number().int(), |
| 1186 | -}); | |
| 1186 | +}).strict(); | |
| 1187 | 1187 | export type Synchronized = z.infer<typeof SynchronizedSchema>; |
| 1188 | 1188 | |
| 1189 | 1189 | export const SystemSchema = z.object({ |
| 1190 | 1190 | "system": z.number().int(), |
| 1191 | -}); | |
| 1191 | +}).strict(); | |
| 1192 | 1192 | export type System = z.infer<typeof SystemSchema>; |
| 1193 | 1193 | |
| 1194 | 1194 | export const TemplateSchema = z.object({ |
| 1195 | 1195 | "template": z.number().int(), |
| 1196 | -}); | |
| 1196 | +}).strict(); | |
| 1197 | 1197 | export type Template = z.infer<typeof TemplateSchema>; |
| 1198 | 1198 | |
| 1199 | 1199 | export const ThenSchema = z.object({ |
| 1200 | 1200 | "then": z.number().int(), |
| 1201 | -}); | |
| 1201 | +}).strict(); | |
| 1202 | 1202 | export type Then = z.infer<typeof ThenSchema>; |
| 1203 | 1203 | |
| 1204 | 1204 | export const ThisSchema = z.object({ |
| 1205 | 1205 | "this": z.number().int(), |
| 1206 | -}); | |
| 1206 | +}).strict(); | |
| 1207 | 1207 | export type This = z.infer<typeof ThisSchema>; |
| 1208 | 1208 | |
| 1209 | 1209 | export const ThreadLocalSchema = z.object({ |
| 1210 | 1210 | "thread_local": z.number().int(), |
| 1211 | -}); | |
| 1211 | +}).strict(); | |
| 1212 | 1212 | export type ThreadLocal = z.infer<typeof ThreadLocalSchema>; |
| 1213 | 1213 | |
| 1214 | 1214 | export const ThrowSchema = z.object({ |
| 1215 | 1215 | "throw": z.number().int(), |
| 1216 | -}); | |
| 1216 | +}).strict(); | |
| 1217 | 1217 | export type Throw = z.infer<typeof ThrowSchema>; |
| 1218 | 1218 | |
| 1219 | 1219 | export const ThrowsSchema = z.object({ |
| 1220 | 1220 | "throws": z.number().int(), |
| 1221 | -}); | |
| 1221 | +}).strict(); | |
| 1222 | 1222 | export type Throws = z.infer<typeof ThrowsSchema>; |
| 1223 | 1223 | |
| 1224 | 1224 | export const ToJsonSchema = z.object({ |
| 1225 | 1225 | "to_json": z.number().int(), |
| 1226 | -}); | |
| 1226 | +}).strict(); | |
| 1227 | 1227 | export type ToJson = z.infer<typeof ToJsonSchema>; |
| 1228 | 1228 | |
| 1229 | 1229 | export const TopLevelClassSchema = z.object({ |
| 1230 | 1230 | "top_level": z.number().int(), |
| 1231 | -}); | |
| 1231 | +}).strict(); | |
| 1232 | 1232 | export type TopLevelClass = z.infer<typeof TopLevelClassSchema>; |
| 1233 | 1233 | |
| 1234 | 1234 | export const TransientSchema = z.object({ |
| 1235 | 1235 | "transient": z.number().int(), |
| 1236 | -}); | |
| 1236 | +}).strict(); | |
| 1237 | 1237 | export type Transient = z.infer<typeof TransientSchema>; |
| 1238 | 1238 | |
| 1239 | 1239 | export const TrueSchema = z.object({ |
| 1240 | 1240 | "True": z.number().int(), |
| 1241 | -}); | |
| 1241 | +}).strict(); | |
| 1242 | 1242 | export type True = z.infer<typeof TrueSchema>; |
| 1243 | 1243 | |
| 1244 | 1244 | export const TrySchema = z.object({ |
| 1245 | 1245 | "try": z.number().int(), |
| 1246 | -}); | |
| 1246 | +}).strict(); | |
| 1247 | 1247 | export type Try = z.infer<typeof TrySchema>; |
| 1248 | 1248 | |
| 1249 | 1249 | export const TypeSchema = z.object({ |
| 1250 | 1250 | "Type": z.number().int(), |
| 1251 | -}); | |
| 1251 | +}).strict(); | |
| 1252 | 1252 | export type Type = z.infer<typeof TypeSchema>; |
| 1253 | 1253 | |
| 1254 | 1254 | export const TypealiasSchema = z.object({ |
| 1255 | 1255 | "typealias": z.number().int(), |
| 1256 | -}); | |
| 1256 | +}).strict(); | |
| 1257 | 1257 | export type Typealias = z.infer<typeof TypealiasSchema>; |
| 1258 | 1258 | |
| 1259 | 1259 | export const TypedefSchema = z.object({ |
| 1260 | 1260 | "typedef": z.number().int(), |
| 1261 | -}); | |
| 1261 | +}).strict(); | |
| 1262 | 1262 | export type Typedef = z.infer<typeof TypedefSchema>; |
| 1263 | 1263 | |
| 1264 | 1264 | export const TypeidSchema = z.object({ |
| 1265 | 1265 | "typeid": z.number().int(), |
| 1266 | -}); | |
| 1266 | +}).strict(); | |
| 1267 | 1267 | export type Typeid = z.infer<typeof TypeidSchema>; |
| 1268 | 1268 | |
| 1269 | 1269 | export const TypenameSchema = z.object({ |
| 1270 | 1270 | "typename": z.number().int(), |
| 1271 | -}); | |
| 1271 | +}).strict(); | |
| 1272 | 1272 | export type Typename = z.infer<typeof TypenameSchema>; |
| 1273 | 1273 | |
| 1274 | 1274 | export const TypeofSchema = z.object({ |
| 1275 | 1275 | "typeof": z.number().int(), |
| 1276 | -}); | |
| 1276 | +}).strict(); | |
| 1277 | 1277 | export type Typeof = z.infer<typeof TypeofSchema>; |
| 1278 | 1278 | |
| 1279 | 1279 | export const UintSchema = z.object({ |
| 1280 | 1280 | "uint": z.number().int(), |
| 1281 | -}); | |
| 1281 | +}).strict(); | |
| 1282 | 1282 | export type Uint = z.infer<typeof UintSchema>; |
| 1283 | 1283 | |
| 1284 | 1284 | export const UlongSchema = z.object({ |
| 1285 | 1285 | "ulong": z.number().int(), |
| 1286 | -}); | |
| 1286 | +}).strict(); | |
| 1287 | 1287 | export type Ulong = z.infer<typeof UlongSchema>; |
| 1288 | 1288 | |
| 1289 | 1289 | export const UncheckedSchema = z.object({ |
| 1290 | 1290 | "unchecked": z.number().int(), |
| 1291 | -}); | |
| 1291 | +}).strict(); | |
| 1292 | 1292 | export type Unchecked = z.infer<typeof UncheckedSchema>; |
| 1293 | 1293 | |
| 1294 | 1294 | export const UndefinedSchema = z.object({ |
| 1295 | 1295 | "undefined": z.number().int(), |
| 1296 | -}); | |
| 1296 | +}).strict(); | |
| 1297 | 1297 | export type Undefined = z.infer<typeof UndefinedSchema>; |
| 1298 | 1298 | |
| 1299 | 1299 | export const UnionSchema = z.object({ |
| 1300 | 1300 | "union": z.number().int(), |
| 1301 | -}); | |
| 1301 | +}).strict(); | |
| 1302 | 1302 | export type Union = z.infer<typeof UnionSchema>; |
| 1303 | 1303 | |
| 1304 | 1304 | export const UnownedSchema = z.object({ |
| 1305 | 1305 | "unowned": z.number().int(), |
| 1306 | -}); | |
| 1306 | +}).strict(); | |
| 1307 | 1307 | export type Unowned = z.infer<typeof UnownedSchema>; |
| 1308 | 1308 | |
| 1309 | 1309 | export const UnsafeSchema = z.object({ |
| 1310 | 1310 | "unsafe": z.number().int(), |
| 1311 | -}); | |
| 1311 | +}).strict(); | |
| 1312 | 1312 | export type Unsafe = z.infer<typeof UnsafeSchema>; |
| 1313 | 1313 | |
| 1314 | 1314 | export const UnsignedSchema = z.object({ |
| 1315 | 1315 | "unsigned": z.number().int(), |
| 1316 | -}); | |
| 1316 | +}).strict(); | |
| 1317 | 1317 | export type Unsigned = z.infer<typeof UnsignedSchema>; |
| 1318 | 1318 | |
| 1319 | 1319 | export const UshortSchema = z.object({ |
| 1320 | 1320 | "ushort": z.number().int(), |
| 1321 | -}); | |
| 1321 | +}).strict(); | |
| 1322 | 1322 | export type Ushort = z.infer<typeof UshortSchema>; |
| 1323 | 1323 | |
| 1324 | 1324 | export const UsingSchema = z.object({ |
| 1325 | 1325 | "using": z.number().int(), |
| 1326 | -}); | |
| 1326 | +}).strict(); | |
| 1327 | 1327 | export type Using = z.infer<typeof UsingSchema>; |
| 1328 | 1328 | |
| 1329 | 1329 | export const VarSchema = z.object({ |
| 1330 | 1330 | "var": z.number().int(), |
| 1331 | -}); | |
| 1331 | +}).strict(); | |
| 1332 | 1332 | export type Var = z.infer<typeof VarSchema>; |
| 1333 | 1333 | |
| 1334 | 1334 | export const VirtualSchema = z.object({ |
| 1335 | 1335 | "virtual": z.number().int(), |
| 1336 | -}); | |
| 1336 | +}).strict(); | |
| 1337 | 1337 | export type Virtual = z.infer<typeof VirtualSchema>; |
| 1338 | 1338 | |
| 1339 | 1339 | export const VoidSchema = z.object({ |
| 1340 | 1340 | "void": z.number().int(), |
| 1341 | -}); | |
| 1341 | +}).strict(); | |
| 1342 | 1342 | export type Void = z.infer<typeof VoidSchema>; |
| 1343 | 1343 | |
| 1344 | 1344 | export const VolatileSchema = z.object({ |
| 1345 | 1345 | "volatile": z.number().int(), |
| 1346 | -}); | |
| 1346 | +}).strict(); | |
| 1347 | 1347 | export type Volatile = z.infer<typeof VolatileSchema>; |
| 1348 | 1348 | |
| 1349 | 1349 | export const WcharTSchema = z.object({ |
| 1350 | 1350 | "wchar_t": z.number().int(), |
| 1351 | -}); | |
| 1351 | +}).strict(); | |
| 1352 | 1352 | export type WcharT = z.infer<typeof WcharTSchema>; |
| 1353 | 1353 | |
| 1354 | 1354 | export const WeakSchema = z.object({ |
| 1355 | 1355 | "weak": z.number().int(), |
| 1356 | -}); | |
| 1356 | +}).strict(); | |
| 1357 | 1357 | export type Weak = z.infer<typeof WeakSchema>; |
| 1358 | 1358 | |
| 1359 | 1359 | export const WhereSchema = z.object({ |
| 1360 | 1360 | "where": z.number().int(), |
| 1361 | -}); | |
| 1361 | +}).strict(); | |
| 1362 | 1362 | export type Where = z.infer<typeof WhereSchema>; |
| 1363 | 1363 | |
| 1364 | 1364 | export const WhileSchema = z.object({ |
| 1365 | 1365 | "while": z.number().int(), |
| 1366 | -}); | |
| 1366 | +}).strict(); | |
| 1367 | 1367 | export type While = z.infer<typeof WhileSchema>; |
| 1368 | 1368 | |
| 1369 | 1369 | export const WillSetSchema = z.object({ |
| 1370 | 1370 | "willSet": z.number().int(), |
| 1371 | -}); | |
| 1371 | +}).strict(); | |
| 1372 | 1372 | export type WillSet = z.infer<typeof WillSetSchema>; |
| 1373 | 1373 | |
| 1374 | 1374 | export const WithSchema = z.object({ |
| 1375 | 1375 | "with": z.number().int(), |
| 1376 | -}); | |
| 1376 | +}).strict(); | |
| 1377 | 1377 | export type With = z.infer<typeof WithSchema>; |
| 1378 | 1378 | |
| 1379 | 1379 | export const XorSchema = z.object({ |
| 1380 | 1380 | "xor": z.number().int(), |
| 1381 | -}); | |
| 1381 | +}).strict(); | |
| 1382 | 1382 | export type Xor = z.infer<typeof XorSchema>; |
| 1383 | 1383 | |
| 1384 | 1384 | export const XorEqSchema = z.object({ |
| 1385 | 1385 | "xor_eq": z.number().int(), |
| 1386 | -}); | |
| 1386 | +}).strict(); | |
| 1387 | 1387 | export type XorEq = z.infer<typeof XorEqSchema>; |
| 1388 | 1388 | |
| 1389 | 1389 | export const YesSchema = z.object({ |
| 1390 | 1390 | "YES": z.number().int(), |
| 1391 | -}); | |
| 1391 | +}).strict(); | |
| 1392 | 1392 | export type Yes = z.infer<typeof YesSchema>; |
| 1393 | 1393 | |
| 1394 | 1394 | export const YieldSchema = z.object({ |
| 1395 | 1395 | "yield": z.number().int(), |
| 1396 | -}); | |
| 1396 | +}).strict(); | |
| 1397 | 1397 | export type Yield = z.infer<typeof YieldSchema>; |
| 1398 | 1398 | |
| 1399 | 1399 | export const Obj1Schema = z.object({ |
| @@ -1463,7 +1463,7 @@ export const Obj1Schema = z.object({ | ||
| 1463 | 1463 | "_Bool": BoolClassSchema, |
| 1464 | 1464 | "class": Obj1ClassSchema, |
| 1465 | 1465 | "bool": Obj1BoolSchema, |
| 1466 | -}); | |
| 1466 | +}).strict(); | |
| 1467 | 1467 | export type Obj1 = z.infer<typeof Obj1Schema>; |
| 1468 | 1468 | |
| 1469 | 1469 | export const Obj2Schema = z.object({ |
| @@ -1533,7 +1533,7 @@ export const Obj2Schema = z.object({ | ||
| 1533 | 1533 | "interface": InterfaceSchema, |
| 1534 | 1534 | "internal": InternalSchema, |
| 1535 | 1535 | "false": FalseClassSchema, |
| 1536 | -}); | |
| 1536 | +}).strict(); | |
| 1537 | 1537 | export type Obj2 = z.infer<typeof Obj2Schema>; |
| 1538 | 1538 | |
| 1539 | 1539 | export const Obj3Schema = z.object({ |
| @@ -1603,7 +1603,7 @@ export const Obj3Schema = z.object({ | ||
| 1603 | 1603 | "private": PrivateSchema, |
| 1604 | 1604 | "protected": ProtectedSchema, |
| 1605 | 1605 | "Protocol": ProtocolSchema, |
| 1606 | -}); | |
| 1606 | +}).strict(); | |
| 1607 | 1607 | export type Obj3 = z.infer<typeof Obj3Schema>; |
| 1608 | 1608 | |
| 1609 | 1609 | export const Obj4Schema = z.object({ |
| @@ -1672,7 +1672,7 @@ export const Obj4Schema = z.object({ | ||
| 1672 | 1672 | "ulong": UlongSchema, |
| 1673 | 1673 | "unchecked": UncheckedSchema, |
| 1674 | 1674 | "undefined": UndefinedSchema, |
| 1675 | -}); | |
| 1675 | +}).strict(); | |
| 1676 | 1676 | export type Obj4 = z.infer<typeof Obj4Schema>; |
| 1677 | 1677 | |
| 1678 | 1678 | export const Obj5Schema = z.object({ |
| @@ -1697,7 +1697,7 @@ export const Obj5Schema = z.object({ | ||
| 1697 | 1697 | "xor_eq": XorEqSchema, |
| 1698 | 1698 | "YES": YesSchema, |
| 1699 | 1699 | "yield": YieldSchema, |
| 1700 | -}); | |
| 1700 | +}).strict(); | |
| 1701 | 1701 | export type Obj5 = z.infer<typeof Obj5Schema>; |
| 1702 | 1702 | |
| 1703 | 1703 | export const TopLevelSchema = z.object({ |
| @@ -1707,5 +1707,5 @@ export const TopLevelSchema = z.object({ | ||
| 1707 | 1707 | "obj3": Obj3Schema, |
| 1708 | 1708 | "obj4": Obj4Schema, |
| 1709 | 1709 | "obj5": Obj5Schema, |
| 1710 | -}); | |
| 1710 | +}).strict(); | |
| 1711 | 1711 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/priority/kotlin-enum-class-case-collision.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -9,7 +9,7 @@ export type Category = z.infer<typeof CategorySchema>; | ||
| 9 | 9 | |
| 10 | 10 | export const TopLevelElementSchema = z.object({ |
| 11 | 11 | "category": CategorySchema, |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 14 | 14 | |
| 15 | 15 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +1 −1test/inputs/json/priority/list.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -9,5 +9,5 @@ export const TopLevelSchema: z.ZodType<TopLevel> = z.lazy(() => | ||
| 9 | 9 | z.object({ |
| 10 | 10 | "data": z.number().int(), |
| 11 | 11 | "next": z.union([z.null(), TopLevelSchema]), |
| 12 | - }) | |
| 12 | + }).strict() | |
| 13 | 13 | ); |
Test case
1 generated file · +1 −1test/inputs/json/priority/name-style.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -9,5 +9,5 @@ export const TopLevelSchema = z.object({ | ||
| 9 | 9 | "should_know_that_id_is_an_initialism": z.string(), |
| 10 | 10 | " spaces are separators too ": z.boolean(), |
| 11 | 11 | "ZSR_HH_DEMO3_DELMATNR": z.boolean(), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +13 −13test/inputs/json/priority/nbl-stats.json
Mtypescript-zoddefault / TopLevel.ts+13 −13
| @@ -95,7 +95,7 @@ export const TeamSchema = z.object({ | ||
| 95 | 95 | "teamCodeInternational": z.string(), |
| 96 | 96 | "teamName": z.string(), |
| 97 | 97 | "teamNameInternational": z.string(), |
| 98 | -}); | |
| 98 | +}).strict(); | |
| 99 | 99 | export type Team = z.infer<typeof TeamSchema>; |
| 100 | 100 | |
| 101 | 101 | export const PbpSchema = z.object({ |
| @@ -123,14 +123,14 @@ export const PbpSchema = z.object({ | ||
| 123 | 123 | "subType": z.string(), |
| 124 | 124 | "success": z.number().int(), |
| 125 | 125 | "tno": z.number().int(), |
| 126 | -}); | |
| 126 | +}).strict(); | |
| 127 | 127 | export type Pbp = z.infer<typeof PbpSchema>; |
| 128 | 128 | |
| 129 | 129 | export const TimeSchema = z.object({ |
| 130 | 130 | "gt": z.string(), |
| 131 | 131 | "per": z.number().int(), |
| 132 | 132 | "perType": PerTypeSchema, |
| 133 | -}); | |
| 133 | +}).strict(); | |
| 134 | 134 | export type Time = z.infer<typeof TimeSchema>; |
| 135 | 135 | |
| 136 | 136 | export const CompSchema = z.object({ |
| @@ -138,7 +138,7 @@ export const CompSchema = z.object({ | ||
| 138 | 138 | "sMinutesAverage": z.string(), |
| 139 | 139 | "sPointsAverage": z.number(), |
| 140 | 140 | "sReboundsTotalAverage": z.number(), |
| 141 | -}); | |
| 141 | +}).strict(); | |
| 142 | 142 | export type Comp = z.infer<typeof CompSchema>; |
| 143 | 143 | |
| 144 | 144 | export const ShotSchema = z.object({ |
| @@ -154,7 +154,7 @@ export const ShotSchema = z.object({ | ||
| 154 | 154 | "tno": z.number().int(), |
| 155 | 155 | "x": z.number().int(), |
| 156 | 156 | "y": z.number().int(), |
| 157 | -}); | |
| 157 | +}).strict(); | |
| 158 | 158 | export type Shot = z.infer<typeof ShotSchema>; |
| 159 | 159 | |
| 160 | 160 | export const OthermatchSchema = z.object({ |
| @@ -169,7 +169,7 @@ export const OthermatchSchema = z.object({ | ||
| 169 | 169 | "team2": TeamSchema, |
| 170 | 170 | "team2Name": z.string(), |
| 171 | 171 | "team2Score": z.number().int(), |
| 172 | -}); | |
| 172 | +}).strict(); | |
| 173 | 173 | export type Othermatch = z.infer<typeof OthermatchSchema>; |
| 174 | 174 | |
| 175 | 175 | export const ScorerSchema = z.object({ |
| @@ -193,12 +193,12 @@ export const ScorerSchema = z.object({ | ||
| 193 | 193 | "times": z.array(TimeSchema).optional(), |
| 194 | 194 | "tno": z.number().int(), |
| 195 | 195 | "tot": z.number().int().optional(), |
| 196 | -}); | |
| 196 | +}).strict(); | |
| 197 | 197 | export type Scorer = z.infer<typeof ScorerSchema>; |
| 198 | 198 | |
| 199 | 199 | export const SBlocksSchema = z.object({ |
| 200 | 200 | "1": ScorerSchema, |
| 201 | -}); | |
| 201 | +}).strict(); | |
| 202 | 202 | export type SBlocks = z.infer<typeof SBlocksSchema>; |
| 203 | 203 | |
| 204 | 204 | export const PlSchema = z.object({ |
| @@ -252,7 +252,7 @@ export const PlSchema = z.object({ | ||
| 252 | 252 | "sTwoPointersPercentage": z.number().int(), |
| 253 | 253 | "shirtNumber": z.string().regex(/^-?\d+$/), |
| 254 | 254 | "starter": z.number().int(), |
| 255 | -}); | |
| 255 | +}).strict(); | |
| 256 | 256 | export type Pl = z.infer<typeof PlSchema>; |
| 257 | 257 | |
| 258 | 258 | export const TotalldsSchema = z.object({ |
| @@ -261,7 +261,7 @@ export const TotalldsSchema = z.object({ | ||
| 261 | 261 | "sPoints": z.record(z.string(), ScorerSchema), |
| 262 | 262 | "sReboundsTotal": z.record(z.string(), ScorerSchema), |
| 263 | 263 | "sSteals": z.record(z.string(), ScorerSchema), |
| 264 | -}); | |
| 264 | +}).strict(); | |
| 265 | 265 | export type Totallds = z.infer<typeof TotalldsSchema>; |
| 266 | 266 | |
| 267 | 267 | export const LdsSchema = z.object({ |
| @@ -270,7 +270,7 @@ export const LdsSchema = z.object({ | ||
| 270 | 270 | "sPoints": z.record(z.string(), ScorerSchema), |
| 271 | 271 | "sReboundsTotal": z.record(z.string(), ScorerSchema), |
| 272 | 272 | "sSteals": z.record(z.string(), ScorerSchema), |
| 273 | -}); | |
| 273 | +}).strict(); | |
| 274 | 274 | export type Lds = z.infer<typeof LdsSchema>; |
| 275 | 275 | |
| 276 | 276 | export const TmSchema = z.object({ |
| @@ -339,7 +339,7 @@ export const TmSchema = z.object({ | ||
| 339 | 339 | "tot_sTwoPointersAttempted": z.number().int(), |
| 340 | 340 | "tot_sTwoPointersMade": z.number().int(), |
| 341 | 341 | "tot_sTwoPointersPercentage": z.number().int(), |
| 342 | -}); | |
| 342 | +}).strict(); | |
| 343 | 343 | export type Tm = z.infer<typeof TmSchema>; |
| 344 | 344 | |
| 345 | 345 | export const TopLevelSchema = z.object({ |
| @@ -363,5 +363,5 @@ export const TopLevelSchema = z.object({ | ||
| 363 | 363 | "tm": z.record(z.string(), TmSchema), |
| 364 | 364 | "totalTimeAdded": z.number().int(), |
| 365 | 365 | "totallds": TotalldsSchema, |
| 366 | -}); | |
| 366 | +}).strict(); | |
| 367 | 367 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/priority/nested-objects.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -4,5 +4,5 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "a": z.record(z.string(), z.number().int()), |
| 6 | 6 | "b": z.record(z.string(), z.number().int()), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +12 −12test/inputs/json/priority/nst-test-suite.json
Mtypescript-zoddefault / TopLevel.ts+12 −12
| @@ -2,60 +2,60 @@ import * as z from "zod"; | ||
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | export const JsonSchema = z.object({ |
| 5 | -}); | |
| 5 | +}).strict(); | |
| 6 | 6 | export type Json = z.infer<typeof JsonSchema>; |
| 7 | 7 | |
| 8 | 8 | export const YObjectBasicJsonSchema = z.object({ |
| 9 | 9 | "asd": z.string(), |
| 10 | -}); | |
| 10 | +}).strict(); | |
| 11 | 11 | export type YObjectBasicJson = z.infer<typeof YObjectBasicJsonSchema>; |
| 12 | 12 | |
| 13 | 13 | export const YObjectEmptyKeyJsonSchema = z.object({ |
| 14 | 14 | "": z.number().int(), |
| 15 | -}); | |
| 15 | +}).strict(); | |
| 16 | 16 | export type YObjectEmptyKeyJson = z.infer<typeof YObjectEmptyKeyJsonSchema>; |
| 17 | 17 | |
| 18 | 18 | export const YObjectEscapedNullInKeyJsonSchema = z.object({ |
| 19 | 19 | "foo\u0000bar": z.number().int(), |
| 20 | -}); | |
| 20 | +}).strict(); | |
| 21 | 21 | export type YObjectEscapedNullInKeyJson = z.infer<typeof YObjectEscapedNullInKeyJsonSchema>; |
| 22 | 22 | |
| 23 | 23 | export const YObjectExtremeNumbersJsonSchema = z.object({ |
| 24 | 24 | "max": z.number(), |
| 25 | 25 | "min": z.number(), |
| 26 | -}); | |
| 26 | +}).strict(); | |
| 27 | 27 | export type YObjectExtremeNumbersJson = z.infer<typeof YObjectExtremeNumbersJsonSchema>; |
| 28 | 28 | |
| 29 | 29 | export const YObjectJsonSchema = z.object({ |
| 30 | 30 | "asd": z.string(), |
| 31 | 31 | "dfg": z.string(), |
| 32 | -}); | |
| 32 | +}).strict(); | |
| 33 | 33 | export type YObjectJson = z.infer<typeof YObjectJsonSchema>; |
| 34 | 34 | |
| 35 | 35 | export const XSchema = z.object({ |
| 36 | 36 | "id": z.string(), |
| 37 | -}); | |
| 37 | +}).strict(); | |
| 38 | 38 | export type X = z.infer<typeof XSchema>; |
| 39 | 39 | |
| 40 | 40 | export const YObjectSimpleJsonSchema = z.object({ |
| 41 | 41 | "a": z.array(z.any()), |
| 42 | -}); | |
| 42 | +}).strict(); | |
| 43 | 43 | export type YObjectSimpleJson = z.infer<typeof YObjectSimpleJsonSchema>; |
| 44 | 44 | |
| 45 | 45 | export const YObjectStringUnicodeJsonSchema = z.object({ |
| 46 | 46 | "title": z.string(), |
| 47 | -}); | |
| 47 | +}).strict(); | |
| 48 | 48 | export type YObjectStringUnicodeJson = z.infer<typeof YObjectStringUnicodeJsonSchema>; |
| 49 | 49 | |
| 50 | 50 | export const YObjectWithNewlinesJsonSchema = z.object({ |
| 51 | 51 | "a": z.string(), |
| 52 | -}); | |
| 52 | +}).strict(); | |
| 53 | 53 | export type YObjectWithNewlinesJson = z.infer<typeof YObjectWithNewlinesJsonSchema>; |
| 54 | 54 | |
| 55 | 55 | export const YObjectLongStringsJsonSchema = z.object({ |
| 56 | 56 | "id": z.string(), |
| 57 | 57 | "x": z.array(XSchema), |
| 58 | -}); | |
| 58 | +}).strict(); | |
| 59 | 59 | export type YObjectLongStringsJson = z.infer<typeof YObjectLongStringsJsonSchema>; |
| 60 | 60 | |
| 61 | 61 | export const TopLevelSchema = z.object({ |
| @@ -152,5 +152,5 @@ export const TopLevelSchema = z.object({ | ||
| 152 | 152 | "y_structure_trailing_newline.json": z.array(z.string()), |
| 153 | 153 | "y_structure_true_in_array.json": z.array(z.boolean()), |
| 154 | 154 | "y_structure_whitespace_array.json": z.array(z.any()), |
| 155 | -}); | |
| 155 | +}).strict(); | |
| 156 | 156 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/priority/number-map.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -3,5 +3,5 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "foo": z.record(z.string(), z.number()), |
| 6 | -}); | |
| 6 | +}).strict(); | |
| 7 | 7 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/json/priority/omit-empty.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -4,10 +4,10 @@ import * as z from "zod"; | ||
| 4 | 4 | export const ResultSchema = z.object({ |
| 5 | 5 | "age": z.number().int(), |
| 6 | 6 | "name": z.null().optional(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Result = z.infer<typeof ResultSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "results": z.array(ResultSchema), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/priority/optional-union.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -3,7 +3,7 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const TopLevelElementSchema = z.object({ |
| 5 | 5 | "a": z.union([z.number().int(), z.string()]).optional(), |
| 6 | -}); | |
| 6 | +}).strict(); | |
| 7 | 7 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 8 | 8 | |
| 9 | 9 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +2 −2test/inputs/json/priority/php-mixed-union.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -3,10 +3,10 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const MixedClassSchema = z.object({ |
| 5 | 5 | "nested": z.string(), |
| 6 | -}); | |
| 6 | +}).strict(); | |
| 7 | 7 | export type MixedClass = z.infer<typeof MixedClassSchema>; |
| 8 | 8 | |
| 9 | 9 | export const TopLevelSchema = z.object({ |
| 10 | 10 | "mixed": z.array(z.union([z.null(), z.boolean(), MixedClassSchema, z.number().int(), z.string()])), |
| 11 | -}); | |
| 11 | +}).strict(); | |
| 12 | 12 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/priority/php-validation.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -7,5 +7,5 @@ export const TopLevelSchema = z.object({ | ||
| 7 | 7 | "integers": z.array(z.number().int()), |
| 8 | 8 | "number": z.number(), |
| 9 | 9 | "string": z.string(), |
| 10 | -}); | |
| 10 | +}).strict(); | |
| 11 | 11 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +17 −17test/inputs/json/priority/recursive.json
Mtypescript-zoddefault / TopLevel.ts+17 −17
| @@ -7,7 +7,7 @@ export type Format = { | ||
| 7 | 7 | export const FormatSchema: z.ZodType<Format> = z.lazy(() => |
| 8 | 8 | z.object({ |
| 9 | 9 | "formats": FormatsClassSchema, |
| 10 | - }) | |
| 10 | + }).strict() | |
| 11 | 11 | ); |
| 12 | 12 | |
| 13 | 13 | export type FormatsClass = { |
| @@ -22,40 +22,40 @@ export const FormatsClassSchema: z.ZodType<FormatsClass> = z.lazy(() => | ||
| 22 | 22 | "height": z.number().int(), |
| 23 | 23 | "url": z.string(), |
| 24 | 24 | "width": z.number().int(), |
| 25 | - }) | |
| 25 | + }).strict() | |
| 26 | 26 | ); |
| 27 | 27 | |
| 28 | 28 | export const LinkLinkSchema = z.object({ |
| 29 | 29 | "type": z.string(), |
| 30 | 30 | "url": z.string(), |
| 31 | -}); | |
| 31 | +}).strict(); | |
| 32 | 32 | export type LinkLink = z.infer<typeof LinkLinkSchema>; |
| 33 | 33 | |
| 34 | 34 | export const CategoryThumbnailSchema = z.object({ |
| 35 | 35 | "url": z.string(), |
| 36 | -}); | |
| 36 | +}).strict(); | |
| 37 | 37 | export type CategoryThumbnail = z.infer<typeof CategoryThumbnailSchema>; |
| 38 | 38 | |
| 39 | 39 | export const EonandyearSchema = z.object({ |
| 40 | 40 | "lowestsetbit": z.number().int(), |
| 41 | -}); | |
| 41 | +}).strict(); | |
| 42 | 42 | export type Eonandyear = z.infer<typeof EonandyearSchema>; |
| 43 | 43 | |
| 44 | 44 | export const XmlschematypeSchema = z.object({ |
| 45 | 45 | "localpart": z.string(), |
| 46 | 46 | "namespaceuri": z.string(), |
| 47 | 47 | "prefix": z.string(), |
| 48 | -}); | |
| 48 | +}).strict(); | |
| 49 | 49 | export type Xmlschematype = z.infer<typeof XmlschematypeSchema>; |
| 50 | 50 | |
| 51 | 51 | export const CurrencySchema = z.object({ |
| 52 | 52 | "abbreviation": z.string(), |
| 53 | -}); | |
| 53 | +}).strict(); | |
| 54 | 54 | export type Currency = z.infer<typeof CurrencySchema>; |
| 55 | 55 | |
| 56 | 56 | export const LinkElementSchema = z.object({ |
| 57 | 57 | "link": LinkLinkSchema, |
| 58 | -}); | |
| 58 | +}).strict(); | |
| 59 | 59 | export type LinkElement = z.infer<typeof LinkElementSchema>; |
| 60 | 60 | |
| 61 | 61 | export const DateClassSchema = z.object({ |
| @@ -70,19 +70,19 @@ export const DateClassSchema = z.object({ | ||
| 70 | 70 | "valid": z.boolean(), |
| 71 | 71 | "xmlschematype": XmlschematypeSchema, |
| 72 | 72 | "year": z.number().int(), |
| 73 | -}); | |
| 73 | +}).strict(); | |
| 74 | 74 | export type DateClass = z.infer<typeof DateClassSchema>; |
| 75 | 75 | |
| 76 | 76 | export const UseraverageratingSchema = z.object({ |
| 77 | 77 | "links": z.array(LinkElementSchema), |
| 78 | 78 | "numcomments": z.number().int(), |
| 79 | 79 | "rating": z.string(), |
| 80 | -}); | |
| 80 | +}).strict(); | |
| 81 | 81 | export type Useraveragerating = z.infer<typeof UseraverageratingSchema>; |
| 82 | 82 | |
| 83 | 83 | export const SpecificationSchema = z.object({ |
| 84 | 84 | "links": z.array(LinkElementSchema), |
| 85 | -}); | |
| 85 | +}).strict(); | |
| 86 | 86 | export type Specification = z.infer<typeof SpecificationSchema>; |
| 87 | 87 | |
| 88 | 88 | export const CategorySchema = z.object({ |
| @@ -94,7 +94,7 @@ export const CategorySchema = z.object({ | ||
| 94 | 94 | "name": z.string(), |
| 95 | 95 | "parentcategoryid": z.number().int(), |
| 96 | 96 | "thumbnail": CategoryThumbnailSchema, |
| 97 | -}); | |
| 97 | +}).strict(); | |
| 98 | 98 | export type Category = z.infer<typeof CategorySchema>; |
| 99 | 99 | |
| 100 | 100 | export const DetailsSchema = z.object({ |
| @@ -105,12 +105,12 @@ export const DetailsSchema = z.object({ | ||
| 105 | 105 | "elapsedtime": z.number().int(), |
| 106 | 106 | "message": z.string(), |
| 107 | 107 | "status": z.string(), |
| 108 | -}); | |
| 108 | +}).strict(); | |
| 109 | 109 | export type Details = z.infer<typeof DetailsSchema>; |
| 110 | 110 | |
| 111 | 111 | export const RatingSchema = z.object({ |
| 112 | 112 | "useraveragerating": UseraverageratingSchema, |
| 113 | -}); | |
| 113 | +}).strict(); | |
| 114 | 114 | export type Rating = z.infer<typeof RatingSchema>; |
| 115 | 115 | |
| 116 | 116 | export const ProductProductSchema = z.object({ |
| @@ -130,12 +130,12 @@ export const ProductProductSchema = z.object({ | ||
| 130 | 130 | "specification": SpecificationSchema, |
| 131 | 131 | "thumbnail": FormatsClassSchema, |
| 132 | 132 | "totalsellers": z.number().int(), |
| 133 | -}); | |
| 133 | +}).strict(); | |
| 134 | 134 | export type ProductProduct = z.infer<typeof ProductProductSchema>; |
| 135 | 135 | |
| 136 | 136 | export const ProductElementSchema = z.object({ |
| 137 | 137 | "product": ProductProductSchema, |
| 138 | -}); | |
| 138 | +}).strict(); | |
| 139 | 139 | export type ProductElement = z.infer<typeof ProductElementSchema>; |
| 140 | 140 | |
| 141 | 141 | export const TopLevelSchema = z.object({ |
| @@ -149,5 +149,5 @@ export const TopLevelSchema = z.object({ | ||
| 149 | 149 | "totalpages": z.number().int(), |
| 150 | 150 | "totalresultsavailable": z.number().int(), |
| 151 | 151 | "totalresultsreturned": z.number().int(), |
| 152 | -}); | |
| 152 | +}).strict(); | |
| 153 | 153 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/priority/simple-identifiers.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -11,5 +11,5 @@ export const TopLevelSchema = z.object({ | ||
| 11 | 11 | "undefined": z.string(), |
| 12 | 12 | "x": z.string(), |
| 13 | 13 | "x y": z.string(), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/json/priority/union-constructor-clash.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -3,11 +3,11 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const BoolInUnionSchema = z.object({ |
| 5 | 5 | "a": z.boolean(), |
| 6 | -}); | |
| 6 | +}).strict(); | |
| 7 | 7 | export type BoolInUnion = z.infer<typeof BoolInUnionSchema>; |
| 8 | 8 | |
| 9 | 9 | export const TopLevelSchema = z.object({ |
| 10 | 10 | "BoolInUnion": BoolInUnionSchema, |
| 11 | 11 | "union": z.array(z.union([z.boolean(), z.number().int()])), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/json/priority/unions.json
Mtypescript-zoddefault / TopLevel.ts+2 −2
| @@ -3,12 +3,12 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const ZClassSchema = z.object({ |
| 5 | 5 | "a": z.boolean(), |
| 6 | -}); | |
| 6 | +}).strict(); | |
| 7 | 7 | export type ZClass = z.infer<typeof ZClassSchema>; |
| 8 | 8 | |
| 9 | 9 | export const TopLevelSchema = z.object({ |
| 10 | 10 | "x": z.array(z.union([z.null(), z.number().int(), z.string()])), |
| 11 | 11 | "y": z.array(z.union([z.null(), z.number().int()])), |
| 12 | 12 | "z": z.array(z.union([z.array(z.number().int()), ZClassSchema, z.number().int()])), |
| 13 | -}); | |
| 13 | +}).strict(); | |
| 14 | 14 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/priority/url.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -4,5 +4,5 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "fromURL": z.string(), |
| 6 | 6 | "url": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/priority/uuids.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -8,5 +8,5 @@ export const TopLevelSchema = z.object({ | ||
| 8 | 8 | "stringValue": z.string(), |
| 9 | 9 | "uuidValue": z.string().uuid(), |
| 10 | 10 | "uuidValues": z.array(z.string().uuid()), |
| 11 | -}); | |
| 11 | +}).strict(); | |
| 12 | 12 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/samples/bitcoin-block.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -7,5 +7,5 @@ export const TopLevelSchema = z.object({ | ||
| 7 | 7 | "height": z.number().int(), |
| 8 | 8 | "time": z.number().int(), |
| 9 | 9 | "txIndexes": z.array(z.number().int()), |
| 10 | -}); | |
| 10 | +}).strict(); | |
| 11 | 11 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/samples/getting-started.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -4,5 +4,5 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "greeting": z.string(), |
| 6 | 6 | "instructions": z.array(z.string()), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +17 −17test/inputs/json/samples/github-events.json
Mtypescript-zoddefault / TopLevel.ts+17 −17
| @@ -14,7 +14,7 @@ export const ActorSchema = z.object({ | ||
| 14 | 14 | "id": z.number().int(), |
| 15 | 15 | "login": z.string(), |
| 16 | 16 | "url": z.string(), |
| 17 | -}); | |
| 17 | +}).strict(); | |
| 18 | 18 | export type Actor = z.infer<typeof ActorSchema>; |
| 19 | 19 | |
| 20 | 20 | export const UserSchema = z.object({ |
| @@ -35,13 +35,13 @@ export const UserSchema = z.object({ | ||
| 35 | 35 | "subscriptions_url": z.string(), |
| 36 | 36 | "type": TypeSchema, |
| 37 | 37 | "url": z.string(), |
| 38 | -}); | |
| 38 | +}).strict(); | |
| 39 | 39 | export type User = z.infer<typeof UserSchema>; |
| 40 | 40 | |
| 41 | 41 | export const AuthorSchema = z.object({ |
| 42 | 42 | "email": z.string(), |
| 43 | 43 | "name": z.string(), |
| 44 | -}); | |
| 44 | +}).strict(); | |
| 45 | 45 | export type Author = z.infer<typeof AuthorSchema>; |
| 46 | 46 | |
| 47 | 47 | export const LabelSchema = z.object({ |
| @@ -50,7 +50,7 @@ export const LabelSchema = z.object({ | ||
| 50 | 50 | "id": z.number().int(), |
| 51 | 51 | "name": z.string(), |
| 52 | 52 | "url": z.string(), |
| 53 | -}); | |
| 53 | +}).strict(); | |
| 54 | 54 | export type Label = z.infer<typeof LabelSchema>; |
| 55 | 55 | |
| 56 | 56 | export const MilestoneSchema = z.object({ |
| @@ -69,7 +69,7 @@ export const MilestoneSchema = z.object({ | ||
| 69 | 69 | "title": z.string(), |
| 70 | 70 | "updated_at": z.coerce.date(), |
| 71 | 71 | "url": z.string(), |
| 72 | -}); | |
| 72 | +}).strict(); | |
| 73 | 73 | export type Milestone = z.infer<typeof MilestoneSchema>; |
| 74 | 74 | |
| 75 | 75 | export const IssuePullRequestSchema = z.object({ |
| @@ -77,7 +77,7 @@ export const IssuePullRequestSchema = z.object({ | ||
| 77 | 77 | "html_url": z.string(), |
| 78 | 78 | "patch_url": z.string(), |
| 79 | 79 | "url": z.string(), |
| 80 | -}); | |
| 80 | +}).strict(); | |
| 81 | 81 | export type IssuePullRequest = z.infer<typeof IssuePullRequestSchema>; |
| 82 | 82 | |
| 83 | 83 | export const BaseRepoSchema = z.object({ |
| @@ -150,19 +150,19 @@ export const BaseRepoSchema = z.object({ | ||
| 150 | 150 | "url": z.string(), |
| 151 | 151 | "watchers": z.number().int(), |
| 152 | 152 | "watchers_count": z.number().int(), |
| 153 | -}); | |
| 153 | +}).strict(); | |
| 154 | 154 | export type BaseRepo = z.infer<typeof BaseRepoSchema>; |
| 155 | 155 | |
| 156 | 156 | export const CommentsSchema = z.object({ |
| 157 | 157 | "href": z.string(), |
| 158 | -}); | |
| 158 | +}).strict(); | |
| 159 | 159 | export type Comments = z.infer<typeof CommentsSchema>; |
| 160 | 160 | |
| 161 | 161 | export const TopLevelRepoSchema = z.object({ |
| 162 | 162 | "id": z.number().int(), |
| 163 | 163 | "name": z.string(), |
| 164 | 164 | "url": z.string(), |
| 165 | -}); | |
| 165 | +}).strict(); | |
| 166 | 166 | export type TopLevelRepo = z.infer<typeof TopLevelRepoSchema>; |
| 167 | 167 | |
| 168 | 168 | export const CommentSchema = z.object({ |
| @@ -174,7 +174,7 @@ export const CommentSchema = z.object({ | ||
| 174 | 174 | "updated_at": z.coerce.date(), |
| 175 | 175 | "url": z.string(), |
| 176 | 176 | "user": UserSchema, |
| 177 | -}); | |
| 177 | +}).strict(); | |
| 178 | 178 | export type Comment = z.infer<typeof CommentSchema>; |
| 179 | 179 | |
| 180 | 180 | export const CommitSchema = z.object({ |
| @@ -183,7 +183,7 @@ export const CommitSchema = z.object({ | ||
| 183 | 183 | "message": z.string(), |
| 184 | 184 | "sha": z.string(), |
| 185 | 185 | "url": z.string(), |
| 186 | -}); | |
| 186 | +}).strict(); | |
| 187 | 187 | export type Commit = z.infer<typeof CommitSchema>; |
| 188 | 188 | |
| 189 | 189 | export const IssueSchema = z.object({ |
| @@ -209,7 +209,7 @@ export const IssueSchema = z.object({ | ||
| 209 | 209 | "updated_at": z.coerce.date(), |
| 210 | 210 | "url": z.string(), |
| 211 | 211 | "user": UserSchema, |
| 212 | -}); | |
| 212 | +}).strict(); | |
| 213 | 213 | export type Issue = z.infer<typeof IssueSchema>; |
| 214 | 214 | |
| 215 | 215 | export const BaseSchema = z.object({ |
| @@ -218,7 +218,7 @@ export const BaseSchema = z.object({ | ||
| 218 | 218 | "repo": BaseRepoSchema, |
| 219 | 219 | "sha": z.string(), |
| 220 | 220 | "user": UserSchema, |
| 221 | -}); | |
| 221 | +}).strict(); | |
| 222 | 222 | export type Base = z.infer<typeof BaseSchema>; |
| 223 | 223 | |
| 224 | 224 | export const LinksSchema = z.object({ |
| @@ -230,7 +230,7 @@ export const LinksSchema = z.object({ | ||
| 230 | 230 | "review_comments": CommentsSchema, |
| 231 | 231 | "self": CommentsSchema, |
| 232 | 232 | "statuses": CommentsSchema, |
| 233 | -}); | |
| 233 | +}).strict(); | |
| 234 | 234 | export type Links = z.infer<typeof LinksSchema>; |
| 235 | 235 | |
| 236 | 236 | export const PayloadPullRequestSchema = z.object({ |
| @@ -275,7 +275,7 @@ export const PayloadPullRequestSchema = z.object({ | ||
| 275 | 275 | "updated_at": z.coerce.date(), |
| 276 | 276 | "url": z.string(), |
| 277 | 277 | "user": UserSchema, |
| 278 | -}); | |
| 278 | +}).strict(); | |
| 279 | 279 | export type PayloadPullRequest = z.infer<typeof PayloadPullRequestSchema>; |
| 280 | 280 | |
| 281 | 281 | export const PayloadSchema = z.object({ |
| @@ -295,7 +295,7 @@ export const PayloadSchema = z.object({ | ||
| 295 | 295 | "ref": z.string().optional(), |
| 296 | 296 | "ref_type": z.string().optional(), |
| 297 | 297 | "size": z.number().int().optional(), |
| 298 | -}); | |
| 298 | +}).strict(); | |
| 299 | 299 | export type Payload = z.infer<typeof PayloadSchema>; |
| 300 | 300 | |
| 301 | 301 | export const TopLevelElementSchema = z.object({ |
| @@ -307,7 +307,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 307 | 307 | "public": z.boolean(), |
| 308 | 308 | "repo": TopLevelRepoSchema, |
| 309 | 309 | "type": z.string(), |
| 310 | -}); | |
| 310 | +}).strict(); | |
| 311 | 311 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 312 | 312 | |
| 313 | 313 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +4 −4test/inputs/json/samples/kitchen-sink.json
Mtypescript-zoddefault / TopLevel.ts+4 −4
| @@ -3,20 +3,20 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const DifferentThingClassSchema = z.object({ |
| 5 | 5 | "name": z.string(), |
| 6 | -}); | |
| 6 | +}).strict(); | |
| 7 | 7 | export type DifferentThingClass = z.infer<typeof DifferentThingClassSchema>; |
| 8 | 8 | |
| 9 | 9 | export const PersonElementSchema = z.object({ |
| 10 | 10 | "intOrString": z.union([z.number().int(), z.string().regex(/^-?\d+$/).transform(Number)]), |
| 11 | 11 | "name": z.string(), |
| 12 | 12 | "optionalValue": z.boolean().optional(), |
| 13 | -}); | |
| 13 | +}).strict(); | |
| 14 | 14 | export type PersonElement = z.infer<typeof PersonElementSchema>; |
| 15 | 15 | |
| 16 | 16 | export const PurplePersonSchema = z.object({ |
| 17 | 17 | "intOrString": z.number().int(), |
| 18 | 18 | "name": z.string(), |
| 19 | -}); | |
| 19 | +}).strict(); | |
| 20 | 20 | export type PurplePerson = z.infer<typeof PurplePersonSchema>; |
| 21 | 21 | |
| 22 | 22 | export const TopLevelSchema = z.object({ |
| @@ -34,5 +34,5 @@ export const TopLevelSchema = z.object({ | ||
| 34 | 34 | "stringValue": z.string(), |
| 35 | 35 | "tuples": z.array(z.array(z.union([z.number().int(), z.string()]))), |
| 36 | 36 | "uuidValue": z.string(), |
| 37 | -}); | |
| 37 | +}).strict(); | |
| 38 | 38 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +3 −3test/inputs/json/samples/null-safe.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -5,7 +5,7 @@ export const AddressSchema = z.object({ | ||
| 5 | 5 | "city": z.string(), |
| 6 | 6 | "country": z.string(), |
| 7 | 7 | "street": z.string(), |
| 8 | -}); | |
| 8 | +}).strict(); | |
| 9 | 9 | export type Address = z.infer<typeof AddressSchema>; |
| 10 | 10 | |
| 11 | 11 | export const ItemSchema = z.object({ |
| @@ -13,10 +13,10 @@ export const ItemSchema = z.object({ | ||
| 13 | 13 | "created_at": z.coerce.date().optional(), |
| 14 | 14 | "name": z.string(), |
| 15 | 15 | "sex": z.union([z.null(), z.number().int()]), |
| 16 | -}); | |
| 16 | +}).strict(); | |
| 17 | 17 | export type Item = z.infer<typeof ItemSchema>; |
| 18 | 18 | |
| 19 | 19 | export const TopLevelSchema = z.object({ |
| 20 | 20 | "item": z.array(ItemSchema), |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +3 −3test/inputs/json/samples/pokedex.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -36,7 +36,7 @@ export type Type = z.infer<typeof TypeSchema>; | ||
| 36 | 36 | export const EvolutionSchema = z.object({ |
| 37 | 37 | "name": z.string(), |
| 38 | 38 | "num": z.string(), |
| 39 | -}); | |
| 39 | +}).strict(); | |
| 40 | 40 | export type Evolution = z.infer<typeof EvolutionSchema>; |
| 41 | 41 | |
| 42 | 42 | export const PokemonSchema = z.object({ |
| @@ -57,10 +57,10 @@ export const PokemonSchema = z.object({ | ||
| 57 | 57 | "type": z.array(TypeSchema), |
| 58 | 58 | "weaknesses": z.array(TypeSchema), |
| 59 | 59 | "weight": z.string(), |
| 60 | -}); | |
| 60 | +}).strict(); | |
| 61 | 61 | export type Pokemon = z.infer<typeof PokemonSchema>; |
| 62 | 62 | |
| 63 | 63 | export const TopLevelSchema = z.object({ |
| 64 | 64 | "pokemon": z.array(PokemonSchema), |
| 65 | -}); | |
| 65 | +}).strict(); | |
| 66 | 66 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +10 −10test/inputs/json/samples/reddit.json
Mtypescript-zoddefault / TopLevel.ts+10 −10
| @@ -53,26 +53,26 @@ export const KindSchema = z.enum([ | ||
| 53 | 53 | export type Kind = z.infer<typeof KindSchema>; |
| 54 | 54 | |
| 55 | 55 | export const MediaEmbedSchema = z.object({ |
| 56 | -}); | |
| 56 | +}).strict(); | |
| 57 | 57 | export type MediaEmbed = z.infer<typeof MediaEmbedSchema>; |
| 58 | 58 | |
| 59 | 59 | export const SourceSchema = z.object({ |
| 60 | 60 | "height": z.number().int(), |
| 61 | 61 | "url": z.string(), |
| 62 | 62 | "width": z.number().int(), |
| 63 | -}); | |
| 63 | +}).strict(); | |
| 64 | 64 | export type Source = z.infer<typeof SourceSchema>; |
| 65 | 65 | |
| 66 | 66 | export const GifSchema = z.object({ |
| 67 | 67 | "resolutions": z.array(SourceSchema), |
| 68 | 68 | "source": SourceSchema, |
| 69 | -}); | |
| 69 | +}).strict(); | |
| 70 | 70 | export type Gif = z.infer<typeof GifSchema>; |
| 71 | 71 | |
| 72 | 72 | export const VariantsSchema = z.object({ |
| 73 | 73 | "gif": GifSchema.optional(), |
| 74 | 74 | "mp4": GifSchema.optional(), |
| 75 | -}); | |
| 75 | +}).strict(); | |
| 76 | 76 | export type Variants = z.infer<typeof VariantsSchema>; |
| 77 | 77 | |
| 78 | 78 | export const ImageSchema = z.object({ |
| @@ -80,13 +80,13 @@ export const ImageSchema = z.object({ | ||
| 80 | 80 | "resolutions": z.array(SourceSchema), |
| 81 | 81 | "source": SourceSchema, |
| 82 | 82 | "variants": VariantsSchema, |
| 83 | -}); | |
| 83 | +}).strict(); | |
| 84 | 84 | export type Image = z.infer<typeof ImageSchema>; |
| 85 | 85 | |
| 86 | 86 | export const PreviewSchema = z.object({ |
| 87 | 87 | "enabled": z.boolean(), |
| 88 | 88 | "images": z.array(ImageSchema), |
| 89 | -}); | |
| 89 | +}).strict(); | |
| 90 | 90 | export type Preview = z.infer<typeof PreviewSchema>; |
| 91 | 91 | |
| 92 | 92 | export const ChildDataSchema = z.object({ |
| @@ -156,13 +156,13 @@ export const ChildDataSchema = z.object({ | ||
| 156 | 156 | "view_count": z.null(), |
| 157 | 157 | "visited": z.boolean(), |
| 158 | 158 | "whitelist_status": WhitelistStatusSchema, |
| 159 | -}); | |
| 159 | +}).strict(); | |
| 160 | 160 | export type ChildData = z.infer<typeof ChildDataSchema>; |
| 161 | 161 | |
| 162 | 162 | export const ChildSchema = z.object({ |
| 163 | 163 | "data": ChildDataSchema, |
| 164 | 164 | "kind": KindSchema, |
| 165 | -}); | |
| 165 | +}).strict(); | |
| 166 | 166 | export type Child = z.infer<typeof ChildSchema>; |
| 167 | 167 | |
| 168 | 168 | export const TopLevelDataSchema = z.object({ |
| @@ -170,11 +170,11 @@ export const TopLevelDataSchema = z.object({ | ||
| 170 | 170 | "before": z.null(), |
| 171 | 171 | "children": z.array(ChildSchema), |
| 172 | 172 | "modhash": z.string(), |
| 173 | -}); | |
| 173 | +}).strict(); | |
| 174 | 174 | export type TopLevelData = z.infer<typeof TopLevelDataSchema>; |
| 175 | 175 | |
| 176 | 176 | export const TopLevelSchema = z.object({ |
| 177 | 177 | "data": TopLevelDataSchema, |
| 178 | 178 | "kind": z.string(), |
| 179 | -}); | |
| 179 | +}).strict(); | |
| 180 | 180 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/json/samples/simple-object.json
Mtypescript-zoddefault / TopLevel.ts+1 −1
| @@ -5,5 +5,5 @@ export const TopLevelSchema = z.object({ | ||
| 5 | 5 | "date": z.number().int(), |
| 6 | 6 | "title": z.string(), |
| 7 | 7 | "validity": z.boolean(), |
| 8 | -}); | |
| 8 | +}).strict(); | |
| 9 | 9 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +8 −8test/inputs/json/samples/spotify-album.json
Mtypescript-zoddefault / TopLevel.ts+8 −8
| @@ -3,25 +3,25 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const ExternalUrlsSchema = z.object({ |
| 5 | 5 | "spotify": z.string(), |
| 6 | -}); | |
| 6 | +}).strict(); | |
| 7 | 7 | export type ExternalUrls = z.infer<typeof ExternalUrlsSchema>; |
| 8 | 8 | |
| 9 | 9 | export const CopyrightSchema = z.object({ |
| 10 | 10 | "text": z.string(), |
| 11 | 11 | "type": z.string(), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type Copyright = z.infer<typeof CopyrightSchema>; |
| 14 | 14 | |
| 15 | 15 | export const ExternalIdsSchema = z.object({ |
| 16 | 16 | "upc": z.string(), |
| 17 | -}); | |
| 17 | +}).strict(); | |
| 18 | 18 | export type ExternalIds = z.infer<typeof ExternalIdsSchema>; |
| 19 | 19 | |
| 20 | 20 | export const ImageSchema = z.object({ |
| 21 | 21 | "height": z.number().int(), |
| 22 | 22 | "url": z.string(), |
| 23 | 23 | "width": z.number().int(), |
| 24 | -}); | |
| 24 | +}).strict(); | |
| 25 | 25 | export type Image = z.infer<typeof ImageSchema>; |
| 26 | 26 | |
| 27 | 27 | export const ArtistSchema = z.object({ |
| @@ -31,7 +31,7 @@ export const ArtistSchema = z.object({ | ||
| 31 | 31 | "name": z.string(), |
| 32 | 32 | "type": z.string(), |
| 33 | 33 | "uri": z.string(), |
| 34 | -}); | |
| 34 | +}).strict(); | |
| 35 | 35 | export type Artist = z.infer<typeof ArtistSchema>; |
| 36 | 36 | |
| 37 | 37 | export const ItemSchema = z.object({ |
| @@ -48,7 +48,7 @@ export const ItemSchema = z.object({ | ||
| 48 | 48 | "track_number": z.number().int(), |
| 49 | 49 | "type": z.string(), |
| 50 | 50 | "uri": z.string(), |
| 51 | -}); | |
| 51 | +}).strict(); | |
| 52 | 52 | export type Item = z.infer<typeof ItemSchema>; |
| 53 | 53 | |
| 54 | 54 | export const TracksSchema = z.object({ |
| @@ -59,7 +59,7 @@ export const TracksSchema = z.object({ | ||
| 59 | 59 | "offset": z.number().int(), |
| 60 | 60 | "previous": z.null(), |
| 61 | 61 | "total": z.number().int(), |
| 62 | -}); | |
| 62 | +}).strict(); | |
| 63 | 63 | export type Tracks = z.infer<typeof TracksSchema>; |
| 64 | 64 | |
| 65 | 65 | export const TopLevelSchema = z.object({ |
| @@ -80,5 +80,5 @@ export const TopLevelSchema = z.object({ | ||
| 80 | 80 | "tracks": TracksSchema, |
| 81 | 81 | "type": z.string(), |
| 82 | 82 | "uri": z.string(), |
| 83 | -}); | |
| 83 | +}).strict(); | |
| 84 | 84 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +3 −3test/inputs/json/samples/us-avg-temperatures.json
Mtypescript-zoddefault / TopLevel.ts+3 −3
| @@ -4,7 +4,7 @@ import * as z from "zod"; | ||
| 4 | 4 | export const DatumSchema = z.object({ |
| 5 | 5 | "anomaly": z.string(), |
| 6 | 6 | "value": z.string(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Datum = z.infer<typeof DatumSchema>; |
| 9 | 9 | |
| 10 | 10 | export const DescriptionSchema = z.object({ |
| @@ -12,11 +12,11 @@ export const DescriptionSchema = z.object({ | ||
| 12 | 12 | "missing": z.number().int(), |
| 13 | 13 | "title": z.string(), |
| 14 | 14 | "units": z.string(), |
| 15 | -}); | |
| 15 | +}).strict(); | |
| 16 | 16 | export type Description = z.infer<typeof DescriptionSchema>; |
| 17 | 17 | |
| 18 | 18 | export const TopLevelSchema = z.object({ |
| 19 | 19 | "data": z.record(z.string(), DatumSchema), |
| 20 | 20 | "description": DescriptionSchema, |
| 21 | -}); | |
| 21 | +}).strict(); | |
| 22 | 22 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +5 −5test/inputs/json/samples/us-senators.json
Mtypescript-zoddefault / TopLevel.ts+5 −5
| @@ -82,7 +82,7 @@ export const MetaSchema = z.object({ | ||
| 82 | 82 | "limit": z.number().int(), |
| 83 | 83 | "offset": z.number().int(), |
| 84 | 84 | "total_count": z.number().int(), |
| 85 | -}); | |
| 85 | +}).strict(); | |
| 86 | 86 | export type Meta = z.infer<typeof MetaSchema>; |
| 87 | 87 | |
| 88 | 88 | export const ExtraSchema = z.object({ |
| @@ -91,7 +91,7 @@ export const ExtraSchema = z.object({ | ||
| 91 | 91 | "fax": z.string().optional(), |
| 92 | 92 | "office": z.string(), |
| 93 | 93 | "rss_url": z.string().optional(), |
| 94 | -}); | |
| 94 | +}).strict(); | |
| 95 | 95 | export type Extra = z.infer<typeof ExtraSchema>; |
| 96 | 96 | |
| 97 | 97 | export const PersonSchema = z.object({ |
| @@ -112,7 +112,7 @@ export const PersonSchema = z.object({ | ||
| 112 | 112 | "sortname": z.string(), |
| 113 | 113 | "twitterid": z.union([z.null(), z.string()]), |
| 114 | 114 | "youtubeid": z.union([z.null(), z.string()]), |
| 115 | -}); | |
| 115 | +}).strict(); | |
| 116 | 116 | export type Person = z.infer<typeof PersonSchema>; |
| 117 | 117 | |
| 118 | 118 | export const ObjectElementSchema = z.object({ |
| @@ -138,11 +138,11 @@ export const ObjectElementSchema = z.object({ | ||
| 138 | 138 | "title": TitleSchema, |
| 139 | 139 | "title_long": RoleTypeLabelSchema, |
| 140 | 140 | "website": z.string(), |
| 141 | -}); | |
| 141 | +}).strict(); | |
| 142 | 142 | export type ObjectElement = z.infer<typeof ObjectElementSchema>; |
| 143 | 143 | |
| 144 | 144 | export const TopLevelSchema = z.object({ |
| 145 | 145 | "meta": MetaSchema, |
| 146 | 146 | "objects": z.array(ObjectElementSchema), |
| 147 | -}); | |
| 147 | +}).strict(); | |
| 148 | 148 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/accessors.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -13,5 +13,5 @@ export const TopLevelSchema = z.object({ | ||
| 13 | 13 | "enum": EnumSchema, |
| 14 | 14 | "foo": z.string(), |
| 15 | 15 | "union": z.union([z.boolean(), z.number()]), |
| 16 | -}); | |
| 16 | +}).strict(); | |
| 17 | 17 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/all-of-additional-properties-false.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -20,5 +20,5 @@ export const TopLevelSchema = z.object({ | ||
| 20 | 20 | "frequency": FrequencySchema, |
| 21 | 21 | "description": z.string().optional(), |
| 22 | 22 | "type": TypeSchema, |
| 23 | -}); | |
| 23 | +}).strict(); | |
| 24 | 24 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/any.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -4,5 +4,5 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "foo": z.any(), |
| 6 | 6 | "values": z.record(z.string(), z.any()), |
| 7 | -}); | |
| 7 | +}).passthrough(); | |
| 8 | 8 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/bool-string.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -14,5 +14,5 @@ export const TopLevelSchema = z.object({ | ||
| 14 | 14 | "optional": z.enum(["true", "false"]).optional(), |
| 15 | 15 | "unionWithBool": z.union([z.boolean(), z.enum(["true", "false"]).transform(x => x === "true")]), |
| 16 | 16 | "unionWithBoolAndEnum": z.union([z.boolean(), z.enum(["true", "false"]).transform(x => x === "true"), UnionWithBoolAndEnumEnumSchema]), |
| 17 | -}); | |
| 17 | +}).passthrough(); | |
| 18 | 18 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/boolean-subschema.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -6,5 +6,5 @@ export const TopLevelSchema = z.object({ | ||
| 6 | 6 | "empty": z.array(z.any()), |
| 7 | 7 | "foo": z.string(), |
| 8 | 8 | "impossible": z.any().optional(), |
| 9 | -}); | |
| 9 | +}).strict(); | |
| 10 | 10 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/camelCase.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -4,5 +4,5 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "myProperty": z.string().optional(), |
| 6 | 6 | "secondProperty": z.string().optional(), |
| 7 | -}); | |
| 7 | +}).passthrough(); | |
| 8 | 8 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +11 −5test/inputs/schema/class-map-union.schema
Mschema-typescript-zoddefault / TopLevel.ts+11 −5
| @@ -1,12 +1,18 @@ | ||
| 1 | 1 | import * as z from "zod"; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -export const UnionClassSchema = z.object({ | |
| 4 | +export const BarObjectSchema = z.object({ | |
| 5 | 5 | "quux": z.number().int().optional(), |
| 6 | -}); | |
| 7 | -export type UnionClass = z.infer<typeof UnionClassSchema>; | |
| 6 | +}).passthrough(); | |
| 7 | +export type BarObject = z.infer<typeof BarObjectSchema>; | |
| 8 | + | |
| 9 | +export const TopLevelUnionSchema = z.object({ | |
| 10 | + "foo": z.union([z.boolean(), z.number(), BarObjectSchema]).optional(), | |
| 11 | + "bar": z.union([z.boolean(), BarObjectSchema, z.string()]).optional(), | |
| 12 | +}).catchall(z.union([z.boolean(), BarObjectSchema])); | |
| 13 | +export type TopLevelUnion = z.infer<typeof TopLevelUnionSchema>; | |
| 8 | 14 | |
| 9 | 15 | export const TopLevelSchema = z.object({ |
| 10 | - "union": z.record(z.string(), z.union([z.boolean(), UnionClassSchema, z.number(), z.string()])).optional(), | |
| 11 | -}); | |
| 16 | + "union": TopLevelUnionSchema.optional(), | |
| 17 | +}).strict(); | |
| 12 | 18 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +7 −2test/inputs/schema/class-with-additional.schema
Mschema-typescript-zoddefault / TopLevel.ts+7 −2
| @@ -1,7 +1,12 @@ | ||
| 1 | 1 | import * as z from "zod"; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | +export const MapSchema = z.object({ | |
| 5 | + "foo": z.number().optional(), | |
| 6 | +}).catchall(z.boolean()); | |
| 7 | +export type Map = z.infer<typeof MapSchema>; | |
| 8 | + | |
| 4 | 9 | export const TopLevelSchema = z.object({ |
| 5 | - "map": z.record(z.string(), z.union([z.boolean(), z.number()])).optional(), | |
| 6 | -}); | |
| 10 | + "map": MapSchema.optional(), | |
| 11 | +}).strict(); | |
| 7 | 12 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
2 generated files · +2 −2test/inputs/schema/comment-injection-enum-nested-comment.schema
Mcomment-injection-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -12,5 +12,5 @@ export type Kind = z.infer<typeof KindSchema>; | ||
| 12 | 12 | |
| 13 | 13 | export const TopLevelSchema = z.object({ |
| 14 | 14 | "kind": KindSchema, |
| 15 | -}); | |
| 15 | +}).strict(); | |
| 16 | 16 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -12,5 +12,5 @@ export type Kind = z.infer<typeof KindSchema>; | ||
| 12 | 12 | |
| 13 | 13 | export const TopLevelSchema = z.object({ |
| 14 | 14 | "kind": KindSchema, |
| 15 | -}); | |
| 15 | +}).strict(); | |
| 16 | 16 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
2 generated files · +2 −2test/inputs/schema/comment-injection-enum.schema
Mcomment-injection-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -15,5 +15,5 @@ export type Kind = z.infer<typeof KindSchema>; | ||
| 15 | 15 | |
| 16 | 16 | export const TopLevelSchema = z.object({ |
| 17 | 17 | "kind": KindSchema, |
| 18 | -}); | |
| 18 | +}).strict(); | |
| 19 | 19 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -15,5 +15,5 @@ export type Kind = z.infer<typeof KindSchema>; | ||
| 15 | 15 | |
| 16 | 16 | export const TopLevelSchema = z.object({ |
| 17 | 17 | "kind": KindSchema, |
| 18 | -}); | |
| 18 | +}).strict(); | |
| 19 | 19 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/comment-injection-nested-comment.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -3,5 +3,5 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "value": z.string(), |
| 6 | -}); | |
| 6 | +}).strict(); | |
| 7 | 7 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/comment-injection.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -6,5 +6,5 @@ export const TopLevelSchema = z.object({ | ||
| 6 | 6 | "trailingQuote": z.string().optional(), |
| 7 | 7 | "trailingTripleQuote": z.string().optional(), |
| 8 | 8 | "value": z.string(), |
| 9 | -}); | |
| 9 | +}).strict(); | |
| 10 | 10 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/const-non-string.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -12,5 +12,5 @@ export const TopLevelSchema = z.object({ | ||
| 12 | 12 | "kind": KindSchema, |
| 13 | 13 | "ratio": z.number(), |
| 14 | 14 | "version": z.number(), |
| 15 | -}); | |
| 15 | +}).passthrough(); | |
| 16 | 16 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/schema/constructor.schema
Mschema-typescript-zoddefault / TopLevel.ts+2 −2
| @@ -2,10 +2,10 @@ import * as z from "zod"; | ||
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | export const ConstructorSchema = z.object({ |
| 5 | -}); | |
| 5 | +}).strict(); | |
| 6 | 6 | export type Constructor = z.infer<typeof ConstructorSchema>; |
| 7 | 7 | |
| 8 | 8 | export const TopLevelSchema = z.preprocess(value => typeof value === "object" && value !== null && !Array.isArray(value) ? Object.assign(Object.create(null), value) : value, z.object({ |
| 9 | 9 | "constructor": z.union([ConstructorSchema, z.number()]).optional(), |
| 10 | -})); | |
| 10 | +}).passthrough()); | |
| 11 | 11 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/cut-enum.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -3,5 +3,5 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "foo": z.number().int(), |
| 6 | -}); | |
| 6 | +}).passthrough(); | |
| 7 | 7 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/date-time-or-string.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -9,5 +9,5 @@ export type BarEnum = z.infer<typeof BarEnumSchema>; | ||
| 9 | 9 | export const TopLevelSchema = z.object({ |
| 10 | 10 | "bar": z.union([BarEnumSchema, z.coerce.date()]), |
| 11 | 11 | "foo": z.string(), |
| 12 | -}); | |
| 12 | +}).passthrough(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/date-time.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -13,5 +13,5 @@ export const TopLevelSchema = z.object({ | ||
| 13 | 13 | "date-time": z.coerce.date(), |
| 14 | 14 | "time": z.string(), |
| 15 | 15 | "union-array": z.array(z.string()), |
| 16 | -}); | |
| 16 | +}).strict(); | |
| 17 | 17 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/default-value.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -3,5 +3,5 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "id": z.number().int(), |
| 6 | -}); | |
| 6 | +}).strict(); | |
| 7 | 7 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/description-with-double-quotes.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -3,5 +3,5 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "foo": z.boolean().optional(), |
| 6 | -}); | |
| 6 | +}).passthrough(); | |
| 7 | 7 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +5 −5test/inputs/schema/description.schema
Mschema-typescript-zoddefault / TopLevel.ts+5 −5
| @@ -8,16 +8,16 @@ export const EnumSchema = z.enum([ | ||
| 8 | 8 | ]); |
| 9 | 9 | export type Enum = z.infer<typeof EnumSchema>; |
| 10 | 10 | |
| 11 | -export const ObjectOrStringClassSchema = z.object({ | |
| 11 | +export const ObjectOrStringObjectSchema = z.object({ | |
| 12 | 12 | "prop": z.number(), |
| 13 | -}); | |
| 14 | -export type ObjectOrStringClass = z.infer<typeof ObjectOrStringClassSchema>; | |
| 13 | +}).passthrough(); | |
| 14 | +export type ObjectOrStringObject = z.infer<typeof ObjectOrStringObjectSchema>; | |
| 15 | 15 | |
| 16 | 16 | export const TopLevelSchema = z.object({ |
| 17 | 17 | "bar": z.boolean().optional(), |
| 18 | 18 | "enum": EnumSchema, |
| 19 | 19 | "foo": z.number().optional(), |
| 20 | - "object-or-string": z.union([ObjectOrStringClassSchema, z.string()]), | |
| 20 | + "object-or-string": z.union([ObjectOrStringObjectSchema, z.string()]), | |
| 21 | 21 | "union": z.union([z.number(), z.string()]), |
| 22 | -}); | |
| 22 | +}).strict(); | |
| 23 | 23 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/schema/direct-union.schema
Mschema-typescript-zoddefault / TopLevel.ts+2 −2
| @@ -4,10 +4,10 @@ import * as z from "zod"; | ||
| 4 | 4 | export const ThingSchema = z.object({ |
| 5 | 5 | "optional": z.union([z.null(), z.array(z.any()), z.boolean(), z.number(), z.number().int(), z.record(z.string(), z.any()), z.string()]).optional(), |
| 6 | 6 | "required": z.union([z.null(), z.array(z.any()), z.boolean(), z.number(), z.number().int(), z.record(z.string(), z.any()), z.string()]), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Thing = z.infer<typeof ThingSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "stuff": z.record(z.string(), ThingSchema), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/enum-large.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -36,5 +36,5 @@ export type Priority = z.infer<typeof PrioritySchema>; | ||
| 36 | 36 | export const TopLevelSchema = z.object({ |
| 37 | 37 | "callsign": CallsignSchema, |
| 38 | 38 | "priority": PrioritySchema, |
| 39 | -}); | |
| 39 | +}).passthrough(); | |
| 40 | 40 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/enum-with-null.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -9,5 +9,5 @@ export type Enum = z.infer<typeof EnumSchema>; | ||
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "enum": z.union([z.null(), EnumSchema]), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/enum-with-values.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -14,5 +14,5 @@ export type Weekdays = z.infer<typeof WeekdaysSchema>; | ||
| 14 | 14 | |
| 15 | 15 | export const TopLevelSchema = z.object({ |
| 16 | 16 | "weekdays": WeekdaysSchema, |
| 17 | -}); | |
| 17 | +}).passthrough(); | |
| 18 | 18 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/enum.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -30,5 +30,5 @@ export const TopLevelSchema = z.object({ | ||
| 30 | 30 | "gve": GveSchema, |
| 31 | 31 | "lvc": LvcSchema.optional(), |
| 32 | 32 | "otherArr": z.array(OtherArrSchema).optional(), |
| 33 | -}); | |
| 33 | +}).passthrough(); | |
| 34 | 34 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/go-schema-pattern-properties.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -3,5 +3,5 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "map": z.record(z.string(), z.number().int()), |
| 6 | -}); | |
| 6 | +}).passthrough(); | |
| 7 | 7 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/haskell-enum-forbidden.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -9,5 +9,5 @@ export type Health = z.infer<typeof HealthSchema>; | ||
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "health": HealthSchema, |
| 12 | -}); | |
| 12 | +}).passthrough(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/id-no-address.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -3,5 +3,5 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "item": z.number().int(), |
| 6 | -}); | |
| 6 | +}).passthrough(); | |
| 7 | 7 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/id-root.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -3,5 +3,5 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "bar": z.number().int(), |
| 6 | -}); | |
| 6 | +}).passthrough(); | |
| 7 | 7 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/schema/ie-suffix-singularization.schema
Mschema-typescript-zoddefault / TopLevel.ts+2 −2
| @@ -4,10 +4,10 @@ import * as z from "zod"; | ||
| 4 | 4 | export const CookieSchema = z.object({ |
| 5 | 5 | "name": z.string(), |
| 6 | 6 | "value": z.string(), |
| 7 | -}); | |
| 7 | +}).passthrough(); | |
| 8 | 8 | export type Cookie = z.infer<typeof CookieSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "cookies": z.array(CookieSchema), |
| 12 | -}); | |
| 12 | +}).passthrough(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/implicit-all-of.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -5,5 +5,5 @@ export const TopLevelSchema = z.object({ | ||
| 5 | 5 | "foo": z.number().int(), |
| 6 | 6 | "bar": z.boolean(), |
| 7 | 7 | "quux": z.string(), |
| 8 | -}); | |
| 8 | +}).passthrough(); | |
| 9 | 9 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +5 −5test/inputs/schema/implicit-class-array-union.schema
Mschema-typescript-zoddefault / TopLevel.ts+5 −5
| @@ -1,12 +1,12 @@ | ||
| 1 | 1 | import * as z from "zod"; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -export const FooClassSchema = z.object({ | |
| 4 | +export const FooObjectSchema = z.object({ | |
| 5 | 5 | "bar": z.number().int(), |
| 6 | -}); | |
| 7 | -export type FooClass = z.infer<typeof FooClassSchema>; | |
| 6 | +}).passthrough(); | |
| 7 | +export type FooObject = z.infer<typeof FooObjectSchema>; | |
| 8 | 8 | |
| 9 | 9 | export const TopLevelSchema = z.object({ |
| 10 | - "foo": z.union([z.null(), z.array(z.number().int()), z.boolean(), FooClassSchema, z.number(), z.number().int(), z.string()]), | |
| 11 | -}); | |
| 10 | + "foo": z.union([z.null(), z.array(z.number().int()), z.boolean(), z.number(), z.number().int(), FooObjectSchema, z.string()]), | |
| 11 | +}).passthrough(); | |
| 12 | 12 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/implicit-one-of.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -5,5 +5,5 @@ export const TopLevelSchema = z.object({ | ||
| 5 | 5 | "foo": z.number().int(), |
| 6 | 6 | "bar": z.boolean().optional(), |
| 7 | 7 | "quux": z.string().optional(), |
| 8 | -}); | |
| 8 | +}).passthrough(); | |
| 9 | 9 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/integer-float-union.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -3,5 +3,5 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "number": z.number(), |
| 6 | -}); | |
| 6 | +}).passthrough(); | |
| 7 | 7 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/integer-string.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -14,5 +14,5 @@ export const TopLevelSchema = z.object({ | ||
| 14 | 14 | "optional": z.string().regex(/^-?\d+$/).optional(), |
| 15 | 15 | "unionWithInt": z.union([z.number().int(), z.string().regex(/^-?\d+$/).transform(Number)]), |
| 16 | 16 | "unionWithIntAndEnum": z.union([UnionWithIntAndEnumEnumSchema, z.number().int(), z.string().regex(/^-?\d+$/).transform(Number)]), |
| 17 | -}); | |
| 17 | +}).passthrough(); | |
| 18 | 18 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/integer-type.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -11,5 +11,5 @@ export const TopLevelSchema = z.object({ | ||
| 11 | 11 | "small_negative": z.number().int().min(-100).max(0), |
| 12 | 12 | "small_positive": z.number().int().min(0).max(100), |
| 13 | 13 | "unbounded": z.number().int(), |
| 14 | -}); | |
| 14 | +}).passthrough(); | |
| 15 | 15 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/intersection-nested.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -3,5 +3,5 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "intersection": z.number().optional(), |
| 6 | -}); | |
| 6 | +}).strict(); | |
| 7 | 7 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/schema/intersection.schema
Mschema-typescript-zoddefault / TopLevel.ts+2 −2
| @@ -4,10 +4,10 @@ import * as z from "zod"; | ||
| 4 | 4 | export const IntersectionSchema = z.object({ |
| 5 | 5 | "foo": z.number(), |
| 6 | 6 | "bar": z.string().optional(), |
| 7 | -}); | |
| 7 | +}).passthrough(); | |
| 8 | 8 | export type Intersection = z.infer<typeof IntersectionSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "intersection": IntersectionSchema.optional(), |
| 12 | -}); | |
| 12 | +}).strict(); | |
| 13 | 13 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/keyword-enum.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -284,5 +284,5 @@ export type Enum = z.infer<typeof EnumSchema>; | ||
| 284 | 284 | |
| 285 | 285 | export const TopLevelSchema = z.object({ |
| 286 | 286 | "enum": EnumSchema.optional(), |
| 287 | -}); | |
| 287 | +}).passthrough(); | |
| 288 | 288 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +354 −354test/inputs/schema/keyword-unions.schema
Mschema-typescript-zoddefault / TopLevel.ts+354 −354
| @@ -1,1108 +1,1108 @@ | ||
| 1 | 1 | import * as z from "zod"; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | +export const AnySchema = z.object({ | |
| 5 | +}).strict(); | |
| 6 | +export type Any = z.infer<typeof AnySchema>; | |
| 7 | + | |
| 8 | +export const BoolSchema = z.object({ | |
| 9 | +}).strict(); | |
| 10 | +export type Bool = z.infer<typeof BoolSchema>; | |
| 11 | + | |
| 12 | +export const ClassClassSchema = z.object({ | |
| 13 | +}).strict(); | |
| 14 | +export type ClassClass = z.infer<typeof ClassClassSchema>; | |
| 15 | + | |
| 16 | +export const FalseSchema = z.object({ | |
| 17 | +}).strict(); | |
| 18 | +export type False = z.infer<typeof FalseSchema>; | |
| 19 | + | |
| 20 | +export const ImpSchema = z.object({ | |
| 21 | +}).strict(); | |
| 22 | +export type Imp = z.infer<typeof ImpSchema>; | |
| 23 | + | |
| 24 | +export const NoSchema = z.object({ | |
| 25 | +}).strict(); | |
| 26 | +export type No = z.infer<typeof NoSchema>; | |
| 27 | + | |
| 28 | +export const NsStringSchema = z.object({ | |
| 29 | +}).strict(); | |
| 30 | +export type NsString = z.infer<typeof NsStringSchema>; | |
| 31 | + | |
| 32 | +export const NullSchema = z.object({ | |
| 33 | +}).strict(); | |
| 34 | +export type Null = z.infer<typeof NullSchema>; | |
| 35 | + | |
| 36 | +export const NoneSchema = z.object({ | |
| 37 | +}).strict(); | |
| 38 | +export type None = z.infer<typeof NoneSchema>; | |
| 39 | + | |
| 40 | +export const ProtocolSchema = z.object({ | |
| 41 | +}).strict(); | |
| 42 | +export type Protocol = z.infer<typeof ProtocolSchema>; | |
| 43 | + | |
| 44 | +export const SelSchema = z.object({ | |
| 45 | +}).strict(); | |
| 46 | +export type Sel = z.infer<typeof SelSchema>; | |
| 47 | + | |
| 48 | +export const SelfSchema = z.object({ | |
| 49 | +}).strict(); | |
| 50 | +export type Self = z.infer<typeof SelfSchema>; | |
| 51 | + | |
| 52 | +export const TrueSchema = z.object({ | |
| 53 | +}).strict(); | |
| 54 | +export type True = z.infer<typeof TrueSchema>; | |
| 55 | + | |
| 56 | +export const TypeSchema = z.object({ | |
| 57 | +}).strict(); | |
| 58 | +export type Type = z.infer<typeof TypeSchema>; | |
| 59 | + | |
| 60 | +export const YesSchema = z.object({ | |
| 61 | +}).strict(); | |
| 62 | +export type Yes = z.infer<typeof YesSchema>; | |
| 63 | + | |
| 64 | +export const EmptySchema = z.object({ | |
| 65 | +}).strict(); | |
| 66 | +export type Empty = z.infer<typeof EmptySchema>; | |
| 67 | + | |
| 68 | +export const BoolClassSchema = z.object({ | |
| 69 | +}).strict(); | |
| 70 | +export type BoolClass = z.infer<typeof BoolClassSchema>; | |
| 71 | + | |
| 72 | +export const ComplexSchema = z.object({ | |
| 73 | +}).strict(); | |
| 74 | +export type Complex = z.infer<typeof ComplexSchema>; | |
| 75 | + | |
| 76 | +export const ImaginerySchema = z.object({ | |
| 77 | +}).strict(); | |
| 78 | +export type Imaginery = z.infer<typeof ImaginerySchema>; | |
| 79 | + | |
| 4 | 80 | export const AbstractSchema = z.object({ |
| 5 | -}); | |
| 81 | +}).strict(); | |
| 6 | 82 | export type Abstract = z.infer<typeof AbstractSchema>; |
| 7 | 83 | |
| 8 | 84 | export const AlignasSchema = z.object({ |
| 9 | -}); | |
| 85 | +}).strict(); | |
| 10 | 86 | export type Alignas = z.infer<typeof AlignasSchema>; |
| 11 | 87 | |
| 12 | 88 | export const AlignofSchema = z.object({ |
| 13 | -}); | |
| 89 | +}).strict(); | |
| 14 | 90 | export type Alignof = z.infer<typeof AlignofSchema>; |
| 15 | 91 | |
| 16 | 92 | export const AndSchema = z.object({ |
| 17 | -}); | |
| 93 | +}).strict(); | |
| 18 | 94 | export type And = z.infer<typeof AndSchema>; |
| 19 | 95 | |
| 20 | 96 | export const AndEqSchema = z.object({ |
| 21 | -}); | |
| 97 | +}).strict(); | |
| 22 | 98 | export type AndEq = z.infer<typeof AndEqSchema>; |
| 23 | 99 | |
| 24 | -export const AnySchema = z.object({ | |
| 25 | -}); | |
| 26 | -export type Any = z.infer<typeof AnySchema>; | |
| 100 | +export const AnyClassSchema = z.object({ | |
| 101 | +}).strict(); | |
| 102 | +export type AnyClass = z.infer<typeof AnyClassSchema>; | |
| 27 | 103 | |
| 28 | 104 | export const ArrayClassSchema = z.object({ |
| 29 | -}); | |
| 105 | +}).strict(); | |
| 30 | 106 | export type ArrayClass = z.infer<typeof ArrayClassSchema>; |
| 31 | 107 | |
| 32 | 108 | export const AsSchema = z.object({ |
| 33 | -}); | |
| 109 | +}).strict(); | |
| 34 | 110 | export type As = z.infer<typeof AsSchema>; |
| 35 | 111 | |
| 36 | 112 | export const AsmSchema = z.object({ |
| 37 | -}); | |
| 113 | +}).strict(); | |
| 38 | 114 | export type Asm = z.infer<typeof AsmSchema>; |
| 39 | 115 | |
| 40 | 116 | export const AssertSchema = z.object({ |
| 41 | -}); | |
| 117 | +}).strict(); | |
| 42 | 118 | export type Assert = z.infer<typeof AssertSchema>; |
| 43 | 119 | |
| 44 | 120 | export const AssociatedtypeSchema = z.object({ |
| 45 | -}); | |
| 121 | +}).strict(); | |
| 46 | 122 | export type Associatedtype = z.infer<typeof AssociatedtypeSchema>; |
| 47 | 123 | |
| 48 | 124 | export const AssociativitySchema = z.object({ |
| 49 | -}); | |
| 125 | +}).strict(); | |
| 50 | 126 | export type Associativity = z.infer<typeof AssociativitySchema>; |
| 51 | 127 | |
| 52 | 128 | export const AsyncSchema = z.object({ |
| 53 | -}); | |
| 129 | +}).strict(); | |
| 54 | 130 | export type Async = z.infer<typeof AsyncSchema>; |
| 55 | 131 | |
| 56 | 132 | export const AtomicSchema = z.object({ |
| 57 | -}); | |
| 133 | +}).strict(); | |
| 58 | 134 | export type Atomic = z.infer<typeof AtomicSchema>; |
| 59 | 135 | |
| 60 | 136 | export const AtomicCancelSchema = z.object({ |
| 61 | -}); | |
| 137 | +}).strict(); | |
| 62 | 138 | export type AtomicCancel = z.infer<typeof AtomicCancelSchema>; |
| 63 | 139 | |
| 64 | 140 | export const AtomicCommitSchema = z.object({ |
| 65 | -}); | |
| 141 | +}).strict(); | |
| 66 | 142 | export type AtomicCommit = z.infer<typeof AtomicCommitSchema>; |
| 67 | 143 | |
| 68 | 144 | export const AtomicNoexceptSchema = z.object({ |
| 69 | -}); | |
| 145 | +}).strict(); | |
| 70 | 146 | export type AtomicNoexcept = z.infer<typeof AtomicNoexceptSchema>; |
| 71 | 147 | |
| 72 | 148 | export const AutoSchema = z.object({ |
| 73 | -}); | |
| 149 | +}).strict(); | |
| 74 | 150 | export type Auto = z.infer<typeof AutoSchema>; |
| 75 | 151 | |
| 76 | 152 | export const AwaitSchema = z.object({ |
| 77 | -}); | |
| 153 | +}).strict(); | |
| 78 | 154 | export type Await = z.infer<typeof AwaitSchema>; |
| 79 | 155 | |
| 80 | 156 | export const BaseSchema = z.object({ |
| 81 | -}); | |
| 157 | +}).strict(); | |
| 82 | 158 | export type Base = z.infer<typeof BaseSchema>; |
| 83 | 159 | |
| 84 | 160 | export const BitandSchema = z.object({ |
| 85 | -}); | |
| 161 | +}).strict(); | |
| 86 | 162 | export type Bitand = z.infer<typeof BitandSchema>; |
| 87 | 163 | |
| 88 | 164 | export const BitorSchema = z.object({ |
| 89 | -}); | |
| 165 | +}).strict(); | |
| 90 | 166 | export type Bitor = z.infer<typeof BitorSchema>; |
| 91 | 167 | |
| 92 | -export const BoolSchema = z.object({ | |
| 93 | -}); | |
| 94 | -export type Bool = z.infer<typeof BoolSchema>; | |
| 168 | +export const UnionBoolBoolSchema = z.object({ | |
| 169 | +}).strict(); | |
| 170 | +export type UnionBoolBool = z.infer<typeof UnionBoolBoolSchema>; | |
| 95 | 171 | |
| 96 | 172 | export const BooleanSchema = z.object({ |
| 97 | -}); | |
| 173 | +}).strict(); | |
| 98 | 174 | export type Boolean = z.infer<typeof BooleanSchema>; |
| 99 | 175 | |
| 100 | 176 | export const BreakSchema = z.object({ |
| 101 | -}); | |
| 177 | +}).strict(); | |
| 102 | 178 | export type Break = z.infer<typeof BreakSchema>; |
| 103 | 179 | |
| 104 | 180 | export const BycopySchema = z.object({ |
| 105 | -}); | |
| 181 | +}).strict(); | |
| 106 | 182 | export type Bycopy = z.infer<typeof BycopySchema>; |
| 107 | 183 | |
| 108 | 184 | export const ByrefSchema = z.object({ |
| 109 | -}); | |
| 185 | +}).strict(); | |
| 110 | 186 | export type Byref = z.infer<typeof ByrefSchema>; |
| 111 | 187 | |
| 112 | 188 | export const ByteSchema = z.object({ |
| 113 | -}); | |
| 189 | +}).strict(); | |
| 114 | 190 | export type Byte = z.infer<typeof ByteSchema>; |
| 115 | 191 | |
| 116 | 192 | export const CaseSchema = z.object({ |
| 117 | -}); | |
| 193 | +}).strict(); | |
| 118 | 194 | export type Case = z.infer<typeof CaseSchema>; |
| 119 | 195 | |
| 120 | 196 | export const CatchSchema = z.object({ |
| 121 | -}); | |
| 197 | +}).strict(); | |
| 122 | 198 | export type Catch = z.infer<typeof CatchSchema>; |
| 123 | 199 | |
| 124 | 200 | export const ChanSchema = z.object({ |
| 125 | -}); | |
| 201 | +}).strict(); | |
| 126 | 202 | export type Chan = z.infer<typeof ChanSchema>; |
| 127 | 203 | |
| 128 | 204 | export const CharSchema = z.object({ |
| 129 | -}); | |
| 205 | +}).strict(); | |
| 130 | 206 | export type Char = z.infer<typeof CharSchema>; |
| 131 | 207 | |
| 132 | 208 | export const Char16TSchema = z.object({ |
| 133 | -}); | |
| 209 | +}).strict(); | |
| 134 | 210 | export type Char16T = z.infer<typeof Char16TSchema>; |
| 135 | 211 | |
| 136 | 212 | export const Char32TSchema = z.object({ |
| 137 | -}); | |
| 213 | +}).strict(); | |
| 138 | 214 | export type Char32T = z.infer<typeof Char32TSchema>; |
| 139 | 215 | |
| 140 | 216 | export const CheckedSchema = z.object({ |
| 141 | -}); | |
| 217 | +}).strict(); | |
| 142 | 218 | export type Checked = z.infer<typeof CheckedSchema>; |
| 143 | 219 | |
| 144 | -export const ClassClassSchema = z.object({ | |
| 145 | -}); | |
| 146 | -export type ClassClass = z.infer<typeof ClassClassSchema>; | |
| 220 | +export const UnionClassClassSchema = z.object({ | |
| 221 | +}).strict(); | |
| 222 | +export type UnionClassClass = z.infer<typeof UnionClassClassSchema>; | |
| 147 | 223 | |
| 148 | 224 | export const CoAwaitSchema = z.object({ |
| 149 | -}); | |
| 225 | +}).strict(); | |
| 150 | 226 | export type CoAwait = z.infer<typeof CoAwaitSchema>; |
| 151 | 227 | |
| 152 | 228 | export const CoReturnSchema = z.object({ |
| 153 | -}); | |
| 229 | +}).strict(); | |
| 154 | 230 | export type CoReturn = z.infer<typeof CoReturnSchema>; |
| 155 | 231 | |
| 156 | 232 | export const CoYieldSchema = z.object({ |
| 157 | -}); | |
| 233 | +}).strict(); | |
| 158 | 234 | export type CoYield = z.infer<typeof CoYieldSchema>; |
| 159 | 235 | |
| 160 | 236 | export const ComplSchema = z.object({ |
| 161 | -}); | |
| 237 | +}).strict(); | |
| 162 | 238 | export type Compl = z.infer<typeof ComplSchema>; |
| 163 | 239 | |
| 164 | -export const ComplexSchema = z.object({ | |
| 165 | -}); | |
| 166 | -export type Complex = z.infer<typeof ComplexSchema>; | |
| 167 | - | |
| 168 | 240 | export const ConceptSchema = z.object({ |
| 169 | -}); | |
| 241 | +}).strict(); | |
| 170 | 242 | export type Concept = z.infer<typeof ConceptSchema>; |
| 171 | 243 | |
| 172 | 244 | export const ConsoleSchema = z.object({ |
| 173 | -}); | |
| 245 | +}).strict(); | |
| 174 | 246 | export type Console = z.infer<typeof ConsoleSchema>; |
| 175 | 247 | |
| 176 | 248 | export const ConstSchema = z.object({ |
| 177 | -}); | |
| 249 | +}).strict(); | |
| 178 | 250 | export type Const = z.infer<typeof ConstSchema>; |
| 179 | 251 | |
| 180 | 252 | export const ConstCastSchema = z.object({ |
| 181 | -}); | |
| 253 | +}).strict(); | |
| 182 | 254 | export type ConstCast = z.infer<typeof ConstCastSchema>; |
| 183 | 255 | |
| 184 | 256 | export const ConstexprSchema = z.object({ |
| 185 | -}); | |
| 257 | +}).strict(); | |
| 186 | 258 | export type Constexpr = z.infer<typeof ConstexprSchema>; |
| 187 | 259 | |
| 188 | 260 | export const ConstructorSchema = z.object({ |
| 189 | -}); | |
| 261 | +}).strict(); | |
| 190 | 262 | export type Constructor = z.infer<typeof ConstructorSchema>; |
| 191 | 263 | |
| 192 | 264 | export const ContinueSchema = z.object({ |
| 193 | -}); | |
| 265 | +}).strict(); | |
| 194 | 266 | export type Continue = z.infer<typeof ContinueSchema>; |
| 195 | 267 | |
| 196 | 268 | export const ConvenienceSchema = z.object({ |
| 197 | -}); | |
| 269 | +}).strict(); | |
| 198 | 270 | export type Convenience = z.infer<typeof ConvenienceSchema>; |
| 199 | 271 | |
| 200 | 272 | export const ConvertSchema = z.object({ |
| 201 | -}); | |
| 273 | +}).strict(); | |
| 202 | 274 | export type Convert = z.infer<typeof ConvertSchema>; |
| 203 | 275 | |
| 204 | 276 | export const ConverterSchema = z.object({ |
| 205 | -}); | |
| 277 | +}).strict(); | |
| 206 | 278 | export type Converter = z.infer<typeof ConverterSchema>; |
| 207 | 279 | |
| 208 | 280 | export const DateClassSchema = z.object({ |
| 209 | -}); | |
| 281 | +}).strict(); | |
| 210 | 282 | export type DateClass = z.infer<typeof DateClassSchema>; |
| 211 | 283 | |
| 212 | 284 | export const DateParseHandlingSchema = z.object({ |
| 213 | -}); | |
| 285 | +}).strict(); | |
| 214 | 286 | export type DateParseHandling = z.infer<typeof DateParseHandlingSchema>; |
| 215 | 287 | |
| 216 | 288 | export const DebuggerSchema = z.object({ |
| 217 | -}); | |
| 289 | +}).strict(); | |
| 218 | 290 | export type Debugger = z.infer<typeof DebuggerSchema>; |
| 219 | 291 | |
| 220 | 292 | export const DecimalSchema = z.object({ |
| 221 | -}); | |
| 293 | +}).strict(); | |
| 222 | 294 | export type Decimal = z.infer<typeof DecimalSchema>; |
| 223 | 295 | |
| 224 | 296 | export const DeclareSchema = z.object({ |
| 225 | -}); | |
| 297 | +}).strict(); | |
| 226 | 298 | export type Declare = z.infer<typeof DeclareSchema>; |
| 227 | 299 | |
| 228 | 300 | export const DecltypeSchema = z.object({ |
| 229 | -}); | |
| 301 | +}).strict(); | |
| 230 | 302 | export type Decltype = z.infer<typeof DecltypeSchema>; |
| 231 | 303 | |
| 232 | 304 | export const DecodeStringSchema = z.object({ |
| 233 | -}); | |
| 305 | +}).strict(); | |
| 234 | 306 | export type DecodeString = z.infer<typeof DecodeStringSchema>; |
| 235 | 307 | |
| 236 | 308 | export const DefSchema = z.object({ |
| 237 | -}); | |
| 309 | +}).strict(); | |
| 238 | 310 | export type Def = z.infer<typeof DefSchema>; |
| 239 | 311 | |
| 240 | 312 | export const DefaultSchema = z.object({ |
| 241 | -}); | |
| 313 | +}).strict(); | |
| 242 | 314 | export type Default = z.infer<typeof DefaultSchema>; |
| 243 | 315 | |
| 244 | 316 | export const DeferSchema = z.object({ |
| 245 | -}); | |
| 317 | +}).strict(); | |
| 246 | 318 | export type Defer = z.infer<typeof DeferSchema>; |
| 247 | 319 | |
| 248 | 320 | export const DeinitSchema = z.object({ |
| 249 | -}); | |
| 321 | +}).strict(); | |
| 250 | 322 | export type Deinit = z.infer<typeof DeinitSchema>; |
| 251 | 323 | |
| 252 | 324 | export const DelSchema = z.object({ |
| 253 | -}); | |
| 325 | +}).strict(); | |
| 254 | 326 | export type Del = z.infer<typeof DelSchema>; |
| 255 | 327 | |
| 256 | 328 | export const DelegateSchema = z.object({ |
| 257 | -}); | |
| 329 | +}).strict(); | |
| 258 | 330 | export type Delegate = z.infer<typeof DelegateSchema>; |
| 259 | 331 | |
| 260 | 332 | export const DeleteSchema = z.object({ |
| 261 | -}); | |
| 333 | +}).strict(); | |
| 262 | 334 | export type Delete = z.infer<typeof DeleteSchema>; |
| 263 | 335 | |
| 264 | 336 | export const DictSchema = z.object({ |
| 265 | -}); | |
| 337 | +}).strict(); | |
| 266 | 338 | export type Dict = z.infer<typeof DictSchema>; |
| 267 | 339 | |
| 268 | 340 | export const DictionarySchema = z.object({ |
| 269 | -}); | |
| 341 | +}).strict(); | |
| 270 | 342 | export type Dictionary = z.infer<typeof DictionarySchema>; |
| 271 | 343 | |
| 272 | 344 | export const DidSetSchema = z.object({ |
| 273 | -}); | |
| 345 | +}).strict(); | |
| 274 | 346 | export type DidSet = z.infer<typeof DidSetSchema>; |
| 275 | 347 | |
| 276 | 348 | export const DoSchema = z.object({ |
| 277 | -}); | |
| 349 | +}).strict(); | |
| 278 | 350 | export type Do = z.infer<typeof DoSchema>; |
| 279 | 351 | |
| 280 | 352 | export const DoubleSchema = z.object({ |
| 281 | -}); | |
| 353 | +}).strict(); | |
| 282 | 354 | export type Double = z.infer<typeof DoubleSchema>; |
| 283 | 355 | |
| 284 | 356 | export const DynamicSchema = z.object({ |
| 285 | -}); | |
| 357 | +}).strict(); | |
| 286 | 358 | export type Dynamic = z.infer<typeof DynamicSchema>; |
| 287 | 359 | |
| 288 | 360 | export const DynamicCastSchema = z.object({ |
| 289 | -}); | |
| 361 | +}).strict(); | |
| 290 | 362 | export type DynamicCast = z.infer<typeof DynamicCastSchema>; |
| 291 | 363 | |
| 292 | 364 | export const ElifSchema = z.object({ |
| 293 | -}); | |
| 365 | +}).strict(); | |
| 294 | 366 | export type Elif = z.infer<typeof ElifSchema>; |
| 295 | 367 | |
| 296 | 368 | export const ElseSchema = z.object({ |
| 297 | -}); | |
| 369 | +}).strict(); | |
| 298 | 370 | export type Else = z.infer<typeof ElseSchema>; |
| 299 | 371 | |
| 300 | -export const EmptySchema = z.object({ | |
| 301 | -}); | |
| 302 | -export type Empty = z.infer<typeof EmptySchema>; | |
| 303 | - | |
| 304 | 372 | export const EncodeQuickTypeSchema = z.object({ |
| 305 | -}); | |
| 373 | +}).strict(); | |
| 306 | 374 | export type EncodeQuickType = z.infer<typeof EncodeQuickTypeSchema>; |
| 307 | 375 | |
| 308 | 376 | export const EnumSchema = z.object({ |
| 309 | -}); | |
| 377 | +}).strict(); | |
| 310 | 378 | export type Enum = z.infer<typeof EnumSchema>; |
| 311 | 379 | |
| 312 | 380 | export const EventSchema = z.object({ |
| 313 | -}); | |
| 381 | +}).strict(); | |
| 314 | 382 | export type Event = z.infer<typeof EventSchema>; |
| 315 | 383 | |
| 316 | 384 | export const ExceptSchema = z.object({ |
| 317 | -}); | |
| 385 | +}).strict(); | |
| 318 | 386 | export type Except = z.infer<typeof ExceptSchema>; |
| 319 | 387 | |
| 320 | 388 | export const ExceptionSchema = z.object({ |
| 321 | -}); | |
| 389 | +}).strict(); | |
| 322 | 390 | export type Exception = z.infer<typeof ExceptionSchema>; |
| 323 | 391 | |
| 324 | 392 | export const ExplicitSchema = z.object({ |
| 325 | -}); | |
| 393 | +}).strict(); | |
| 326 | 394 | export type Explicit = z.infer<typeof ExplicitSchema>; |
| 327 | 395 | |
| 328 | 396 | export const ExportSchema = z.object({ |
| 329 | -}); | |
| 397 | +}).strict(); | |
| 330 | 398 | export type Export = z.infer<typeof ExportSchema>; |
| 331 | 399 | |
| 332 | 400 | export const ExposingSchema = z.object({ |
| 333 | -}); | |
| 401 | +}).strict(); | |
| 334 | 402 | export type Exposing = z.infer<typeof ExposingSchema>; |
| 335 | 403 | |
| 336 | 404 | export const ExtendsSchema = z.object({ |
| 337 | -}); | |
| 405 | +}).strict(); | |
| 338 | 406 | export type Extends = z.infer<typeof ExtendsSchema>; |
| 339 | 407 | |
| 340 | 408 | export const ExtensionSchema = z.object({ |
| 341 | -}); | |
| 409 | +}).strict(); | |
| 342 | 410 | export type Extension = z.infer<typeof ExtensionSchema>; |
| 343 | 411 | |
| 344 | 412 | export const ExternSchema = z.object({ |
| 345 | -}); | |
| 413 | +}).strict(); | |
| 346 | 414 | export type Extern = z.infer<typeof ExternSchema>; |
| 347 | 415 | |
| 348 | 416 | export const FallthroughSchema = z.object({ |
| 349 | -}); | |
| 417 | +}).strict(); | |
| 350 | 418 | export type Fallthrough = z.infer<typeof FallthroughSchema>; |
| 351 | 419 | |
| 352 | -export const FalseSchema = z.object({ | |
| 353 | -}); | |
| 354 | -export type False = z.infer<typeof FalseSchema>; | |
| 420 | +export const FalseClassSchema = z.object({ | |
| 421 | +}).strict(); | |
| 422 | +export type FalseClass = z.infer<typeof FalseClassSchema>; | |
| 355 | 423 | |
| 356 | 424 | export const FileprivateSchema = z.object({ |
| 357 | -}); | |
| 425 | +}).strict(); | |
| 358 | 426 | export type Fileprivate = z.infer<typeof FileprivateSchema>; |
| 359 | 427 | |
| 360 | 428 | export const FinalSchema = z.object({ |
| 361 | -}); | |
| 429 | +}).strict(); | |
| 362 | 430 | export type Final = z.infer<typeof FinalSchema>; |
| 363 | 431 | |
| 364 | 432 | export const FinallySchema = z.object({ |
| 365 | -}); | |
| 433 | +}).strict(); | |
| 366 | 434 | export type Finally = z.infer<typeof FinallySchema>; |
| 367 | 435 | |
| 368 | 436 | export const FixedSchema = z.object({ |
| 369 | -}); | |
| 437 | +}).strict(); | |
| 370 | 438 | export type Fixed = z.infer<typeof FixedSchema>; |
| 371 | 439 | |
| 372 | 440 | export const FloatSchema = z.object({ |
| 373 | -}); | |
| 441 | +}).strict(); | |
| 374 | 442 | export type Float = z.infer<typeof FloatSchema>; |
| 375 | 443 | |
| 376 | 444 | export const ForSchema = z.object({ |
| 377 | -}); | |
| 445 | +}).strict(); | |
| 378 | 446 | export type For = z.infer<typeof ForSchema>; |
| 379 | 447 | |
| 380 | 448 | export const ForeachSchema = z.object({ |
| 381 | -}); | |
| 449 | +}).strict(); | |
| 382 | 450 | export type Foreach = z.infer<typeof ForeachSchema>; |
| 383 | 451 | |
| 384 | 452 | export const FriendSchema = z.object({ |
| 385 | -}); | |
| 453 | +}).strict(); | |
| 386 | 454 | export type Friend = z.infer<typeof FriendSchema>; |
| 387 | 455 | |
| 388 | 456 | export const FromSchema = z.object({ |
| 389 | -}); | |
| 457 | +}).strict(); | |
| 390 | 458 | export type From = z.infer<typeof FromSchema>; |
| 391 | 459 | |
| 392 | 460 | export const FromJsonSchema = z.object({ |
| 393 | -}); | |
| 461 | +}).strict(); | |
| 394 | 462 | export type FromJson = z.infer<typeof FromJsonSchema>; |
| 395 | 463 | |
| 396 | 464 | export const FuncSchema = z.object({ |
| 397 | -}); | |
| 465 | +}).strict(); | |
| 398 | 466 | export type Func = z.infer<typeof FuncSchema>; |
| 399 | 467 | |
| 400 | 468 | export const FunctionSchema = z.object({ |
| 401 | -}); | |
| 469 | +}).strict(); | |
| 402 | 470 | export type Function = z.infer<typeof FunctionSchema>; |
| 403 | 471 | |
| 404 | 472 | export const GetSchema = z.object({ |
| 405 | -}); | |
| 473 | +}).strict(); | |
| 406 | 474 | export type Get = z.infer<typeof GetSchema>; |
| 407 | 475 | |
| 408 | 476 | export const GlobalSchema = z.object({ |
| 409 | -}); | |
| 477 | +}).strict(); | |
| 410 | 478 | export type Global = z.infer<typeof GlobalSchema>; |
| 411 | 479 | |
| 412 | 480 | export const GoSchema = z.object({ |
| 413 | -}); | |
| 481 | +}).strict(); | |
| 414 | 482 | export type Go = z.infer<typeof GoSchema>; |
| 415 | 483 | |
| 416 | 484 | export const GotoSchema = z.object({ |
| 417 | -}); | |
| 485 | +}).strict(); | |
| 418 | 486 | export type Goto = z.infer<typeof GotoSchema>; |
| 419 | 487 | |
| 420 | 488 | export const GuardSchema = z.object({ |
| 421 | -}); | |
| 489 | +}).strict(); | |
| 422 | 490 | export type Guard = z.infer<typeof GuardSchema>; |
| 423 | 491 | |
| 424 | 492 | export const HasOwnPropertySchema = z.object({ |
| 425 | -}); | |
| 493 | +}).strict(); | |
| 426 | 494 | export type HasOwnProperty = z.infer<typeof HasOwnPropertySchema>; |
| 427 | 495 | |
| 428 | 496 | export const IdSchema = z.object({ |
| 429 | -}); | |
| 497 | +}).strict(); | |
| 430 | 498 | export type Id = z.infer<typeof IdSchema>; |
| 431 | 499 | |
| 432 | 500 | export const IfSchema = z.object({ |
| 433 | -}); | |
| 501 | +}).strict(); | |
| 434 | 502 | export type If = z.infer<typeof IfSchema>; |
| 435 | 503 | |
| 436 | -export const ImaginerySchema = z.object({ | |
| 437 | -}); | |
| 438 | -export type Imaginery = z.infer<typeof ImaginerySchema>; | |
| 439 | - | |
| 440 | -export const ImpSchema = z.object({ | |
| 441 | -}); | |
| 442 | -export type Imp = z.infer<typeof ImpSchema>; | |
| 443 | - | |
| 444 | 504 | export const ImplementsSchema = z.object({ |
| 445 | -}); | |
| 505 | +}).strict(); | |
| 446 | 506 | export type Implements = z.infer<typeof ImplementsSchema>; |
| 447 | 507 | |
| 448 | 508 | export const ImplicitSchema = z.object({ |
| 449 | -}); | |
| 509 | +}).strict(); | |
| 450 | 510 | export type Implicit = z.infer<typeof ImplicitSchema>; |
| 451 | 511 | |
| 452 | 512 | export const ImportSchema = z.object({ |
| 453 | -}); | |
| 513 | +}).strict(); | |
| 454 | 514 | export type Import = z.infer<typeof ImportSchema>; |
| 455 | 515 | |
| 456 | 516 | export const InSchema = z.object({ |
| 457 | -}); | |
| 517 | +}).strict(); | |
| 458 | 518 | export type In = z.infer<typeof InSchema>; |
| 459 | 519 | |
| 460 | 520 | export const IndirectSchema = z.object({ |
| 461 | -}); | |
| 521 | +}).strict(); | |
| 462 | 522 | export type Indirect = z.infer<typeof IndirectSchema>; |
| 463 | 523 | |
| 464 | 524 | export const InfixSchema = z.object({ |
| 465 | -}); | |
| 525 | +}).strict(); | |
| 466 | 526 | export type Infix = z.infer<typeof InfixSchema>; |
| 467 | 527 | |
| 468 | 528 | export const InitSchema = z.object({ |
| 469 | -}); | |
| 529 | +}).strict(); | |
| 470 | 530 | export type Init = z.infer<typeof InitSchema>; |
| 471 | 531 | |
| 472 | 532 | export const InlineSchema = z.object({ |
| 473 | -}); | |
| 533 | +}).strict(); | |
| 474 | 534 | export type Inline = z.infer<typeof InlineSchema>; |
| 475 | 535 | |
| 476 | 536 | export const InoutSchema = z.object({ |
| 477 | -}); | |
| 537 | +}).strict(); | |
| 478 | 538 | export type Inout = z.infer<typeof InoutSchema>; |
| 479 | 539 | |
| 480 | 540 | export const InstanceofSchema = z.object({ |
| 481 | -}); | |
| 541 | +}).strict(); | |
| 482 | 542 | export type Instanceof = z.infer<typeof InstanceofSchema>; |
| 483 | 543 | |
| 484 | 544 | export const IntSchema = z.object({ |
| 485 | -}); | |
| 545 | +}).strict(); | |
| 486 | 546 | export type Int = z.infer<typeof IntSchema>; |
| 487 | 547 | |
| 488 | 548 | export const InterfaceSchema = z.object({ |
| 489 | -}); | |
| 549 | +}).strict(); | |
| 490 | 550 | export type Interface = z.infer<typeof InterfaceSchema>; |
| 491 | 551 | |
| 492 | 552 | export const InternalSchema = z.object({ |
| 493 | -}); | |
| 553 | +}).strict(); | |
| 494 | 554 | export type Internal = z.infer<typeof InternalSchema>; |
| 495 | 555 | |
| 496 | 556 | export const IsSchema = z.object({ |
| 497 | -}); | |
| 557 | +}).strict(); | |
| 498 | 558 | export type Is = z.infer<typeof IsSchema>; |
| 499 | 559 | |
| 500 | 560 | export const IterableSchema = z.object({ |
| 501 | -}); | |
| 561 | +}).strict(); | |
| 502 | 562 | export type Iterable = z.infer<typeof IterableSchema>; |
| 503 | 563 | |
| 504 | 564 | export const JdecSchema = z.object({ |
| 505 | -}); | |
| 565 | +}).strict(); | |
| 506 | 566 | export type Jdec = z.infer<typeof JdecSchema>; |
| 507 | 567 | |
| 508 | 568 | export const JencSchema = z.object({ |
| 509 | -}); | |
| 569 | +}).strict(); | |
| 510 | 570 | export type Jenc = z.infer<typeof JencSchema>; |
| 511 | 571 | |
| 512 | 572 | export const JpipeSchema = z.object({ |
| 513 | -}); | |
| 573 | +}).strict(); | |
| 514 | 574 | export type Jpipe = z.infer<typeof JpipeSchema>; |
| 515 | 575 | |
| 516 | 576 | export const JsonSchema = z.object({ |
| 517 | -}); | |
| 577 | +}).strict(); | |
| 518 | 578 | export type Json = z.infer<typeof JsonSchema>; |
| 519 | 579 | |
| 520 | 580 | export const JsonConverterSchema = z.object({ |
| 521 | -}); | |
| 581 | +}).strict(); | |
| 522 | 582 | export type JsonConverter = z.infer<typeof JsonConverterSchema>; |
| 523 | 583 | |
| 524 | 584 | export const JsonSerializerSchema = z.object({ |
| 525 | -}); | |
| 585 | +}).strict(); | |
| 526 | 586 | export type JsonSerializer = z.infer<typeof JsonSerializerSchema>; |
| 527 | 587 | |
| 528 | 588 | export const JsonTokenSchema = z.object({ |
| 529 | -}); | |
| 589 | +}).strict(); | |
| 530 | 590 | export type JsonToken = z.infer<typeof JsonTokenSchema>; |
| 531 | 591 | |
| 532 | 592 | export const JsonWriterSchema = z.object({ |
| 533 | -}); | |
| 593 | +}).strict(); | |
| 534 | 594 | export type JsonWriter = z.infer<typeof JsonWriterSchema>; |
| 535 | 595 | |
| 536 | 596 | export const LambdaSchema = z.object({ |
| 537 | -}); | |
| 597 | +}).strict(); | |
| 538 | 598 | export type Lambda = z.infer<typeof LambdaSchema>; |
| 539 | 599 | |
| 540 | 600 | export const LazySchema = z.object({ |
| 541 | -}); | |
| 601 | +}).strict(); | |
| 542 | 602 | export type Lazy = z.infer<typeof LazySchema>; |
| 543 | 603 | |
| 544 | 604 | export const LeftSchema = z.object({ |
| 545 | -}); | |
| 605 | +}).strict(); | |
| 546 | 606 | export type Left = z.infer<typeof LeftSchema>; |
| 547 | 607 | |
| 548 | 608 | export const LetSchema = z.object({ |
| 549 | -}); | |
| 609 | +}).strict(); | |
| 550 | 610 | export type Let = z.infer<typeof LetSchema>; |
| 551 | 611 | |
| 552 | 612 | export const ListSchema = z.object({ |
| 553 | -}); | |
| 613 | +}).strict(); | |
| 554 | 614 | export type List = z.infer<typeof ListSchema>; |
| 555 | 615 | |
| 556 | 616 | export const LockSchema = z.object({ |
| 557 | -}); | |
| 617 | +}).strict(); | |
| 558 | 618 | export type Lock = z.infer<typeof LockSchema>; |
| 559 | 619 | |
| 560 | 620 | export const LongSchema = z.object({ |
| 561 | -}); | |
| 621 | +}).strict(); | |
| 562 | 622 | export type Long = z.infer<typeof LongSchema>; |
| 563 | 623 | |
| 564 | 624 | export const MapSchema = z.object({ |
| 565 | -}); | |
| 625 | +}).strict(); | |
| 566 | 626 | export type Map = z.infer<typeof MapSchema>; |
| 567 | 627 | |
| 568 | 628 | export const MetadataPropertyHandlingSchema = z.object({ |
| 569 | -}); | |
| 629 | +}).strict(); | |
| 570 | 630 | export type MetadataPropertyHandling = z.infer<typeof MetadataPropertyHandlingSchema>; |
| 571 | 631 | |
| 572 | 632 | export const ModuleSchema = z.object({ |
| 573 | -}); | |
| 633 | +}).strict(); | |
| 574 | 634 | export type Module = z.infer<typeof ModuleSchema>; |
| 575 | 635 | |
| 576 | 636 | export const MutableSchema = z.object({ |
| 577 | -}); | |
| 637 | +}).strict(); | |
| 578 | 638 | export type Mutable = z.infer<typeof MutableSchema>; |
| 579 | 639 | |
| 580 | 640 | export const MutatingSchema = z.object({ |
| 581 | -}); | |
| 641 | +}).strict(); | |
| 582 | 642 | export type Mutating = z.infer<typeof MutatingSchema>; |
| 583 | 643 | |
| 584 | 644 | export const NamespaceSchema = z.object({ |
| 585 | -}); | |
| 645 | +}).strict(); | |
| 586 | 646 | export type Namespace = z.infer<typeof NamespaceSchema>; |
| 587 | 647 | |
| 588 | 648 | export const NativeSchema = z.object({ |
| 589 | -}); | |
| 649 | +}).strict(); | |
| 590 | 650 | export type Native = z.infer<typeof NativeSchema>; |
| 591 | 651 | |
| 592 | 652 | export const NewSchema = z.object({ |
| 593 | -}); | |
| 653 | +}).strict(); | |
| 594 | 654 | export type New = z.infer<typeof NewSchema>; |
| 595 | 655 | |
| 596 | 656 | export const NewtonsoftSchema = z.object({ |
| 597 | -}); | |
| 657 | +}).strict(); | |
| 598 | 658 | export type Newtonsoft = z.infer<typeof NewtonsoftSchema>; |
| 599 | 659 | |
| 600 | 660 | export const NilSchema = z.object({ |
| 601 | -}); | |
| 661 | +}).strict(); | |
| 602 | 662 | export type Nil = z.infer<typeof NilSchema>; |
| 603 | 663 | |
| 604 | -export const NoSchema = z.object({ | |
| 605 | -}); | |
| 606 | -export type No = z.infer<typeof NoSchema>; | |
| 607 | - | |
| 608 | 664 | export const NoexceptSchema = z.object({ |
| 609 | -}); | |
| 665 | +}).strict(); | |
| 610 | 666 | export type Noexcept = z.infer<typeof NoexceptSchema>; |
| 611 | 667 | |
| 612 | 668 | export const NonatomicSchema = z.object({ |
| 613 | -}); | |
| 669 | +}).strict(); | |
| 614 | 670 | export type Nonatomic = z.infer<typeof NonatomicSchema>; |
| 615 | 671 | |
| 616 | -export const NoneSchema = z.object({ | |
| 617 | -}); | |
| 618 | -export type None = z.infer<typeof NoneSchema>; | |
| 672 | +export const NoneClassSchema = z.object({ | |
| 673 | +}).strict(); | |
| 674 | +export type NoneClass = z.infer<typeof NoneClassSchema>; | |
| 619 | 675 | |
| 620 | 676 | export const NonlocalSchema = z.object({ |
| 621 | -}); | |
| 677 | +}).strict(); | |
| 622 | 678 | export type Nonlocal = z.infer<typeof NonlocalSchema>; |
| 623 | 679 | |
| 624 | 680 | export const NonmutatingSchema = z.object({ |
| 625 | -}); | |
| 681 | +}).strict(); | |
| 626 | 682 | export type Nonmutating = z.infer<typeof NonmutatingSchema>; |
| 627 | 683 | |
| 628 | 684 | export const NotSchema = z.object({ |
| 629 | -}); | |
| 685 | +}).strict(); | |
| 630 | 686 | export type Not = z.infer<typeof NotSchema>; |
| 631 | 687 | |
| 632 | 688 | export const NotEqSchema = z.object({ |
| 633 | -}); | |
| 689 | +}).strict(); | |
| 634 | 690 | export type NotEq = z.infer<typeof NotEqSchema>; |
| 635 | 691 | |
| 636 | -export const NsStringSchema = z.object({ | |
| 637 | -}); | |
| 638 | -export type NsString = z.infer<typeof NsStringSchema>; | |
| 639 | - | |
| 640 | -export const NullSchema = z.object({ | |
| 641 | -}); | |
| 642 | -export type Null = z.infer<typeof NullSchema>; | |
| 692 | +export const NullClassSchema = z.object({ | |
| 693 | +}).strict(); | |
| 694 | +export type NullClass = z.infer<typeof NullClassSchema>; | |
| 643 | 695 | |
| 644 | 696 | export const NullptrSchema = z.object({ |
| 645 | -}); | |
| 697 | +}).strict(); | |
| 646 | 698 | export type Nullptr = z.infer<typeof NullptrSchema>; |
| 647 | 699 | |
| 648 | 700 | export const NumberSchema = z.object({ |
| 649 | -}); | |
| 701 | +}).strict(); | |
| 650 | 702 | export type Number = z.infer<typeof NumberSchema>; |
| 651 | 703 | |
| 652 | 704 | export const ObjectClassSchema = z.object({ |
| 653 | -}); | |
| 705 | +}).strict(); | |
| 654 | 706 | export type ObjectClass = z.infer<typeof ObjectClassSchema>; |
| 655 | 707 | |
| 656 | 708 | export const OfSchema = z.object({ |
| 657 | -}); | |
| 709 | +}).strict(); | |
| 658 | 710 | export type Of = z.infer<typeof OfSchema>; |
| 659 | 711 | |
| 660 | 712 | export const OnewaySchema = z.object({ |
| 661 | -}); | |
| 713 | +}).strict(); | |
| 662 | 714 | export type Oneway = z.infer<typeof OnewaySchema>; |
| 663 | 715 | |
| 664 | 716 | export const OpenSchema = z.object({ |
| 665 | -}); | |
| 717 | +}).strict(); | |
| 666 | 718 | export type Open = z.infer<typeof OpenSchema>; |
| 667 | 719 | |
| 668 | 720 | export const OperatorSchema = z.object({ |
| 669 | -}); | |
| 721 | +}).strict(); | |
| 670 | 722 | export type Operator = z.infer<typeof OperatorSchema>; |
| 671 | 723 | |
| 672 | 724 | export const OptionalSchema = z.object({ |
| 673 | -}); | |
| 725 | +}).strict(); | |
| 674 | 726 | export type Optional = z.infer<typeof OptionalSchema>; |
| 675 | 727 | |
| 676 | 728 | export const OrSchema = z.object({ |
| 677 | -}); | |
| 729 | +}).strict(); | |
| 678 | 730 | export type Or = z.infer<typeof OrSchema>; |
| 679 | 731 | |
| 680 | 732 | export const OrEqSchema = z.object({ |
| 681 | -}); | |
| 733 | +}).strict(); | |
| 682 | 734 | export type OrEq = z.infer<typeof OrEqSchema>; |
| 683 | 735 | |
| 684 | 736 | export const OutSchema = z.object({ |
| 685 | -}); | |
| 737 | +}).strict(); | |
| 686 | 738 | export type Out = z.infer<typeof OutSchema>; |
| 687 | 739 | |
| 688 | 740 | export const OverrideSchema = z.object({ |
| 689 | -}); | |
| 741 | +}).strict(); | |
| 690 | 742 | export type Override = z.infer<typeof OverrideSchema>; |
| 691 | 743 | |
| 692 | 744 | export const PackageSchema = z.object({ |
| 693 | -}); | |
| 745 | +}).strict(); | |
| 694 | 746 | export type Package = z.infer<typeof PackageSchema>; |
| 695 | 747 | |
| 696 | 748 | export const ParamsSchema = z.object({ |
| 697 | -}); | |
| 749 | +}).strict(); | |
| 698 | 750 | export type Params = z.infer<typeof ParamsSchema>; |
| 699 | 751 | |
| 700 | 752 | export const PassSchema = z.object({ |
| 701 | -}); | |
| 753 | +}).strict(); | |
| 702 | 754 | export type Pass = z.infer<typeof PassSchema>; |
| 703 | 755 | |
| 704 | 756 | export const PortSchema = z.object({ |
| 705 | -}); | |
| 757 | +}).strict(); | |
| 706 | 758 | export type Port = z.infer<typeof PortSchema>; |
| 707 | 759 | |
| 708 | 760 | export const PostfixSchema = z.object({ |
| 709 | -}); | |
| 761 | +}).strict(); | |
| 710 | 762 | export type Postfix = z.infer<typeof PostfixSchema>; |
| 711 | 763 | |
| 712 | 764 | export const PrecedenceSchema = z.object({ |
| 713 | -}); | |
| 765 | +}).strict(); | |
| 714 | 766 | export type Precedence = z.infer<typeof PrecedenceSchema>; |
| 715 | 767 | |
| 716 | 768 | export const PrefixSchema = z.object({ |
| 717 | -}); | |
| 769 | +}).strict(); | |
| 718 | 770 | export type Prefix = z.infer<typeof PrefixSchema>; |
| 719 | 771 | |
| 720 | 772 | export const PrintSchema = z.object({ |
| 721 | -}); | |
| 773 | +}).strict(); | |
| 722 | 774 | export type Print = z.infer<typeof PrintSchema>; |
| 723 | 775 | |
| 724 | 776 | export const PrintfSchema = z.object({ |
| 725 | -}); | |
| 777 | +}).strict(); | |
| 726 | 778 | export type Printf = z.infer<typeof PrintfSchema>; |
| 727 | 779 | |
| 728 | 780 | export const PrivateSchema = z.object({ |
| 729 | -}); | |
| 781 | +}).strict(); | |
| 730 | 782 | export type Private = z.infer<typeof PrivateSchema>; |
| 731 | 783 | |
| 732 | 784 | export const ProtectedSchema = z.object({ |
| 733 | -}); | |
| 785 | +}).strict(); | |
| 734 | 786 | export type Protected = z.infer<typeof ProtectedSchema>; |
| 735 | 787 | |
| 736 | -export const ProtocolSchema = z.object({ | |
| 737 | -}); | |
| 738 | -export type Protocol = z.infer<typeof ProtocolSchema>; | |
| 788 | +export const ProtocolClassSchema = z.object({ | |
| 789 | +}).strict(); | |
| 790 | +export type ProtocolClass = z.infer<typeof ProtocolClassSchema>; | |
| 739 | 791 | |
| 740 | 792 | export const PublicSchema = z.object({ |
| 741 | -}); | |
| 793 | +}).strict(); | |
| 742 | 794 | export type Public = z.infer<typeof PublicSchema>; |
| 743 | 795 | |
| 744 | -export const UnionBoolBoolSchema = z.object({ | |
| 745 | -}); | |
| 746 | -export type UnionBoolBool = z.infer<typeof UnionBoolBoolSchema>; | |
| 747 | - | |
| 748 | 796 | export const QuicktypeSchema = z.object({ |
| 749 | -}); | |
| 797 | +}).strict(); | |
| 750 | 798 | export type Quicktype = z.infer<typeof QuicktypeSchema>; |
| 751 | 799 | |
| 752 | 800 | export const RaiseSchema = z.object({ |
| 753 | -}); | |
| 801 | +}).strict(); | |
| 754 | 802 | export type Raise = z.infer<typeof RaiseSchema>; |
| 755 | 803 | |
| 756 | 804 | export const RangeSchema = z.object({ |
| 757 | -}); | |
| 805 | +}).strict(); | |
| 758 | 806 | export type Range = z.infer<typeof RangeSchema>; |
| 759 | 807 | |
| 760 | 808 | export const ReadonlySchema = z.object({ |
| 761 | -}); | |
| 809 | +}).strict(); | |
| 762 | 810 | export type Readonly = z.infer<typeof ReadonlySchema>; |
| 763 | 811 | |
| 764 | 812 | export const RefSchema = z.object({ |
| 765 | -}); | |
| 813 | +}).strict(); | |
| 766 | 814 | export type Ref = z.infer<typeof RefSchema>; |
| 767 | 815 | |
| 768 | 816 | export const RegisterSchema = z.object({ |
| 769 | -}); | |
| 817 | +}).strict(); | |
| 770 | 818 | export type Register = z.infer<typeof RegisterSchema>; |
| 771 | 819 | |
| 772 | 820 | export const ReinterpretCastSchema = z.object({ |
| 773 | -}); | |
| 821 | +}).strict(); | |
| 774 | 822 | export type ReinterpretCast = z.infer<typeof ReinterpretCastSchema>; |
| 775 | 823 | |
| 776 | 824 | export const RepeatSchema = z.object({ |
| 777 | -}); | |
| 825 | +}).strict(); | |
| 778 | 826 | export type Repeat = z.infer<typeof RepeatSchema>; |
| 779 | 827 | |
| 780 | 828 | export const RequireSchema = z.object({ |
| 781 | -}); | |
| 829 | +}).strict(); | |
| 782 | 830 | export type Require = z.infer<typeof RequireSchema>; |
| 783 | 831 | |
| 784 | 832 | export const RequiredSchema = z.object({ |
| 785 | -}); | |
| 833 | +}).strict(); | |
| 786 | 834 | export type Required = z.infer<typeof RequiredSchema>; |
| 787 | 835 | |
| 788 | 836 | export const RequiresSchema = z.object({ |
| 789 | -}); | |
| 837 | +}).strict(); | |
| 790 | 838 | export type Requires = z.infer<typeof RequiresSchema>; |
| 791 | 839 | |
| 792 | 840 | export const RestrictSchema = z.object({ |
| 793 | -}); | |
| 841 | +}).strict(); | |
| 794 | 842 | export type Restrict = z.infer<typeof RestrictSchema>; |
| 795 | 843 | |
| 796 | 844 | export const RetainSchema = z.object({ |
| 797 | -}); | |
| 845 | +}).strict(); | |
| 798 | 846 | export type Retain = z.infer<typeof RetainSchema>; |
| 799 | 847 | |
| 800 | 848 | export const RethrowsSchema = z.object({ |
| 801 | -}); | |
| 849 | +}).strict(); | |
| 802 | 850 | export type Rethrows = z.infer<typeof RethrowsSchema>; |
| 803 | 851 | |
| 804 | 852 | export const ReturnSchema = z.object({ |
| 805 | -}); | |
| 853 | +}).strict(); | |
| 806 | 854 | export type Return = z.infer<typeof ReturnSchema>; |
| 807 | 855 | |
| 808 | 856 | export const RightSchema = z.object({ |
| 809 | -}); | |
| 857 | +}).strict(); | |
| 810 | 858 | export type Right = z.infer<typeof RightSchema>; |
| 811 | 859 | |
| 812 | 860 | export const SbyteSchema = z.object({ |
| 813 | -}); | |
| 861 | +}).strict(); | |
| 814 | 862 | export type Sbyte = z.infer<typeof SbyteSchema>; |
| 815 | 863 | |
| 816 | 864 | export const SealedSchema = z.object({ |
| 817 | -}); | |
| 865 | +}).strict(); | |
| 818 | 866 | export type Sealed = z.infer<typeof SealedSchema>; |
| 819 | 867 | |
| 820 | -export const SelSchema = z.object({ | |
| 821 | -}); | |
| 822 | -export type Sel = z.infer<typeof SelSchema>; | |
| 823 | - | |
| 824 | 868 | export const SelectSchema = z.object({ |
| 825 | -}); | |
| 869 | +}).strict(); | |
| 826 | 870 | export type Select = z.infer<typeof SelectSchema>; |
| 827 | 871 | |
| 828 | -export const SelfSchema = z.object({ | |
| 829 | -}); | |
| 830 | -export type Self = z.infer<typeof SelfSchema>; | |
| 872 | +export const SelfClassSchema = z.object({ | |
| 873 | +}).strict(); | |
| 874 | +export type SelfClass = z.infer<typeof SelfClassSchema>; | |
| 831 | 875 | |
| 832 | 876 | export const SerializeSchema = z.object({ |
| 833 | -}); | |
| 877 | +}).strict(); | |
| 834 | 878 | export type Serialize = z.infer<typeof SerializeSchema>; |
| 835 | 879 | |
| 836 | 880 | export const SetSchema = z.object({ |
| 837 | -}); | |
| 881 | +}).strict(); | |
| 838 | 882 | export type Set = z.infer<typeof SetSchema>; |
| 839 | 883 | |
| 840 | 884 | export const ShortSchema = z.object({ |
| 841 | -}); | |
| 885 | +}).strict(); | |
| 842 | 886 | export type Short = z.infer<typeof ShortSchema>; |
| 843 | 887 | |
| 844 | 888 | export const SignedSchema = z.object({ |
| 845 | -}); | |
| 889 | +}).strict(); | |
| 846 | 890 | export type Signed = z.infer<typeof SignedSchema>; |
| 847 | 891 | |
| 848 | 892 | export const SizeofSchema = z.object({ |
| 849 | -}); | |
| 893 | +}).strict(); | |
| 850 | 894 | export type Sizeof = z.infer<typeof SizeofSchema>; |
| 851 | 895 | |
| 852 | 896 | export const StackallocSchema = z.object({ |
| 853 | -}); | |
| 897 | +}).strict(); | |
| 854 | 898 | export type Stackalloc = z.infer<typeof StackallocSchema>; |
| 855 | 899 | |
| 856 | 900 | export const StaticSchema = z.object({ |
| 857 | -}); | |
| 901 | +}).strict(); | |
| 858 | 902 | export type Static = z.infer<typeof StaticSchema>; |
| 859 | 903 | |
| 860 | 904 | export const StaticAssertSchema = z.object({ |
| 861 | -}); | |
| 905 | +}).strict(); | |
| 862 | 906 | export type StaticAssert = z.infer<typeof StaticAssertSchema>; |
| 863 | 907 | |
| 864 | 908 | export const StaticCastSchema = z.object({ |
| 865 | -}); | |
| 909 | +}).strict(); | |
| 866 | 910 | export type StaticCast = z.infer<typeof StaticCastSchema>; |
| 867 | 911 | |
| 868 | 912 | export const StrictfpSchema = z.object({ |
| 869 | -}); | |
| 913 | +}).strict(); | |
| 870 | 914 | export type Strictfp = z.infer<typeof StrictfpSchema>; |
| 871 | 915 | |
| 872 | 916 | export const StringClassSchema = z.object({ |
| 873 | -}); | |
| 917 | +}).strict(); | |
| 874 | 918 | export type StringClass = z.infer<typeof StringClassSchema>; |
| 875 | 919 | |
| 876 | 920 | export const StructSchema = z.object({ |
| 877 | -}); | |
| 921 | +}).strict(); | |
| 878 | 922 | export type Struct = z.infer<typeof StructSchema>; |
| 879 | 923 | |
| 880 | 924 | export const SubscriptSchema = z.object({ |
| 881 | -}); | |
| 925 | +}).strict(); | |
| 882 | 926 | export type Subscript = z.infer<typeof SubscriptSchema>; |
| 883 | 927 | |
| 884 | 928 | export const SuperSchema = z.object({ |
| 885 | -}); | |
| 929 | +}).strict(); | |
| 886 | 930 | export type Super = z.infer<typeof SuperSchema>; |
| 887 | 931 | |
| 888 | 932 | export const SwitchSchema = z.object({ |
| 889 | -}); | |
| 933 | +}).strict(); | |
| 890 | 934 | export type Switch = z.infer<typeof SwitchSchema>; |
| 891 | 935 | |
| 892 | 936 | export const SymbolSchema = z.object({ |
| 893 | -}); | |
| 937 | +}).strict(); | |
| 894 | 938 | export type Symbol = z.infer<typeof SymbolSchema>; |
| 895 | 939 | |
| 896 | 940 | export const SynchronizedSchema = z.object({ |
| 897 | -}); | |
| 941 | +}).strict(); | |
| 898 | 942 | export type Synchronized = z.infer<typeof SynchronizedSchema>; |
| 899 | 943 | |
| 900 | 944 | export const SystemSchema = z.object({ |
| 901 | -}); | |
| 945 | +}).strict(); | |
| 902 | 946 | export type System = z.infer<typeof SystemSchema>; |
| 903 | 947 | |
| 904 | 948 | export const TemplateSchema = z.object({ |
| 905 | -}); | |
| 949 | +}).strict(); | |
| 906 | 950 | export type Template = z.infer<typeof TemplateSchema>; |
| 907 | 951 | |
| 908 | 952 | export const ThenSchema = z.object({ |
| 909 | -}); | |
| 953 | +}).strict(); | |
| 910 | 954 | export type Then = z.infer<typeof ThenSchema>; |
| 911 | 955 | |
| 912 | 956 | export const ThisSchema = z.object({ |
| 913 | -}); | |
| 957 | +}).strict(); | |
| 914 | 958 | export type This = z.infer<typeof ThisSchema>; |
| 915 | 959 | |
| 916 | 960 | export const ThreadLocalSchema = z.object({ |
| 917 | -}); | |
| 961 | +}).strict(); | |
| 918 | 962 | export type ThreadLocal = z.infer<typeof ThreadLocalSchema>; |
| 919 | 963 | |
| 920 | 964 | export const ThrowSchema = z.object({ |
| 921 | -}); | |
| 965 | +}).strict(); | |
| 922 | 966 | export type Throw = z.infer<typeof ThrowSchema>; |
| 923 | 967 | |
| 924 | 968 | export const ThrowsSchema = z.object({ |
| 925 | -}); | |
| 969 | +}).strict(); | |
| 926 | 970 | export type Throws = z.infer<typeof ThrowsSchema>; |
| 927 | 971 | |
| 928 | 972 | export const ToJsonSchema = z.object({ |
| 929 | -}); | |
| 973 | +}).strict(); | |
| 930 | 974 | export type ToJson = z.infer<typeof ToJsonSchema>; |
| 931 | 975 | |
| 932 | 976 | export const TopLevelClassSchema = z.object({ |
| 933 | -}); | |
| 977 | +}).strict(); | |
| 934 | 978 | export type TopLevelClass = z.infer<typeof TopLevelClassSchema>; |
| 935 | 979 | |
| 936 | -export const AnyClassSchema = z.object({ | |
| 937 | -}); | |
| 938 | -export type AnyClass = z.infer<typeof AnyClassSchema>; | |
| 939 | - | |
| 940 | -export const BoolClassSchema = z.object({ | |
| 941 | -}); | |
| 942 | -export type BoolClass = z.infer<typeof BoolClassSchema>; | |
| 943 | - | |
| 944 | -export const UnionClassClassSchema = z.object({ | |
| 945 | -}); | |
| 946 | -export type UnionClassClass = z.infer<typeof UnionClassClassSchema>; | |
| 947 | - | |
| 948 | -export const FalseClassSchema = z.object({ | |
| 949 | -}); | |
| 950 | -export type FalseClass = z.infer<typeof FalseClassSchema>; | |
| 951 | - | |
| 952 | -export const NoneClassSchema = z.object({ | |
| 953 | -}); | |
| 954 | -export type NoneClass = z.infer<typeof NoneClassSchema>; | |
| 955 | - | |
| 956 | -export const NullClassSchema = z.object({ | |
| 957 | -}); | |
| 958 | -export type NullClass = z.infer<typeof NullClassSchema>; | |
| 959 | - | |
| 960 | -export const ProtocolClassSchema = z.object({ | |
| 961 | -}); | |
| 962 | -export type ProtocolClass = z.infer<typeof ProtocolClassSchema>; | |
| 963 | - | |
| 964 | -export const SelfClassSchema = z.object({ | |
| 965 | -}); | |
| 966 | -export type SelfClass = z.infer<typeof SelfClassSchema>; | |
| 967 | - | |
| 968 | -export const TrueClassSchema = z.object({ | |
| 969 | -}); | |
| 970 | -export type TrueClass = z.infer<typeof TrueClassSchema>; | |
| 971 | - | |
| 972 | -export const TypeClassSchema = z.object({ | |
| 973 | -}); | |
| 974 | -export type TypeClass = z.infer<typeof TypeClassSchema>; | |
| 975 | - | |
| 976 | 980 | export const TransientSchema = z.object({ |
| 977 | -}); | |
| 981 | +}).strict(); | |
| 978 | 982 | export type Transient = z.infer<typeof TransientSchema>; |
| 979 | 983 | |
| 980 | -export const TrueSchema = z.object({ | |
| 981 | -}); | |
| 982 | -export type True = z.infer<typeof TrueSchema>; | |
| 984 | +export const TrueClassSchema = z.object({ | |
| 985 | +}).strict(); | |
| 986 | +export type TrueClass = z.infer<typeof TrueClassSchema>; | |
| 983 | 987 | |
| 984 | 988 | export const TrySchema = z.object({ |
| 985 | -}); | |
| 989 | +}).strict(); | |
| 986 | 990 | export type Try = z.infer<typeof TrySchema>; |
| 987 | 991 | |
| 988 | -export const TypeSchema = z.object({ | |
| 989 | -}); | |
| 990 | -export type Type = z.infer<typeof TypeSchema>; | |
| 992 | +export const TypeClassSchema = z.object({ | |
| 993 | +}).strict(); | |
| 994 | +export type TypeClass = z.infer<typeof TypeClassSchema>; | |
| 991 | 995 | |
| 992 | 996 | export const TypealiasSchema = z.object({ |
| 993 | -}); | |
| 997 | +}).strict(); | |
| 994 | 998 | export type Typealias = z.infer<typeof TypealiasSchema>; |
| 995 | 999 | |
| 996 | 1000 | export const TypedefSchema = z.object({ |
| 997 | -}); | |
| 1001 | +}).strict(); | |
| 998 | 1002 | export type Typedef = z.infer<typeof TypedefSchema>; |
| 999 | 1003 | |
| 1000 | 1004 | export const TypeidSchema = z.object({ |
| 1001 | -}); | |
| 1005 | +}).strict(); | |
| 1002 | 1006 | export type Typeid = z.infer<typeof TypeidSchema>; |
| 1003 | 1007 | |
| 1004 | 1008 | export const TypenameSchema = z.object({ |
| 1005 | -}); | |
| 1009 | +}).strict(); | |
| 1006 | 1010 | export type Typename = z.infer<typeof TypenameSchema>; |
| 1007 | 1011 | |
| 1008 | 1012 | export const TypeofSchema = z.object({ |
| 1009 | -}); | |
| 1013 | +}).strict(); | |
| 1010 | 1014 | export type Typeof = z.infer<typeof TypeofSchema>; |
| 1011 | 1015 | |
| 1012 | 1016 | export const UintSchema = z.object({ |
| 1013 | -}); | |
| 1017 | +}).strict(); | |
| 1014 | 1018 | export type Uint = z.infer<typeof UintSchema>; |
| 1015 | 1019 | |
| 1016 | 1020 | export const UlongSchema = z.object({ |
| 1017 | -}); | |
| 1021 | +}).strict(); | |
| 1018 | 1022 | export type Ulong = z.infer<typeof UlongSchema>; |
| 1019 | 1023 | |
| 1020 | 1024 | export const UncheckedSchema = z.object({ |
| 1021 | -}); | |
| 1025 | +}).strict(); | |
| 1022 | 1026 | export type Unchecked = z.infer<typeof UncheckedSchema>; |
| 1023 | 1027 | |
| 1024 | 1028 | export const UndefinedSchema = z.object({ |
| 1025 | -}); | |
| 1029 | +}).strict(); | |
| 1026 | 1030 | export type Undefined = z.infer<typeof UndefinedSchema>; |
| 1027 | 1031 | |
| 1028 | 1032 | export const UnionSchema = z.object({ |
| 1029 | -}); | |
| 1033 | +}).strict(); | |
| 1030 | 1034 | export type Union = z.infer<typeof UnionSchema>; |
| 1031 | 1035 | |
| 1032 | 1036 | export const UnownedSchema = z.object({ |
| 1033 | -}); | |
| 1037 | +}).strict(); | |
| 1034 | 1038 | export type Unowned = z.infer<typeof UnownedSchema>; |
| 1035 | 1039 | |
| 1036 | 1040 | export const UnsafeSchema = z.object({ |
| 1037 | -}); | |
| 1041 | +}).strict(); | |
| 1038 | 1042 | export type Unsafe = z.infer<typeof UnsafeSchema>; |
| 1039 | 1043 | |
| 1040 | 1044 | export const UnsignedSchema = z.object({ |
| 1041 | -}); | |
| 1045 | +}).strict(); | |
| 1042 | 1046 | export type Unsigned = z.infer<typeof UnsignedSchema>; |
| 1043 | 1047 | |
| 1044 | 1048 | export const UshortSchema = z.object({ |
| 1045 | -}); | |
| 1049 | +}).strict(); | |
| 1046 | 1050 | export type Ushort = z.infer<typeof UshortSchema>; |
| 1047 | 1051 | |
| 1048 | 1052 | export const UsingSchema = z.object({ |
| 1049 | -}); | |
| 1053 | +}).strict(); | |
| 1050 | 1054 | export type Using = z.infer<typeof UsingSchema>; |
| 1051 | 1055 | |
| 1052 | 1056 | export const VarSchema = z.object({ |
| 1053 | -}); | |
| 1057 | +}).strict(); | |
| 1054 | 1058 | export type Var = z.infer<typeof VarSchema>; |
| 1055 | 1059 | |
| 1056 | 1060 | export const VirtualSchema = z.object({ |
| 1057 | -}); | |
| 1061 | +}).strict(); | |
| 1058 | 1062 | export type Virtual = z.infer<typeof VirtualSchema>; |
| 1059 | 1063 | |
| 1060 | 1064 | export const VoidSchema = z.object({ |
| 1061 | -}); | |
| 1065 | +}).strict(); | |
| 1062 | 1066 | export type Void = z.infer<typeof VoidSchema>; |
| 1063 | 1067 | |
| 1064 | 1068 | export const VolatileSchema = z.object({ |
| 1065 | -}); | |
| 1069 | +}).strict(); | |
| 1066 | 1070 | export type Volatile = z.infer<typeof VolatileSchema>; |
| 1067 | 1071 | |
| 1068 | 1072 | export const WcharTSchema = z.object({ |
| 1069 | -}); | |
| 1073 | +}).strict(); | |
| 1070 | 1074 | export type WcharT = z.infer<typeof WcharTSchema>; |
| 1071 | 1075 | |
| 1072 | 1076 | export const WeakSchema = z.object({ |
| 1073 | -}); | |
| 1077 | +}).strict(); | |
| 1074 | 1078 | export type Weak = z.infer<typeof WeakSchema>; |
| 1075 | 1079 | |
| 1076 | 1080 | export const WhereSchema = z.object({ |
| 1077 | -}); | |
| 1081 | +}).strict(); | |
| 1078 | 1082 | export type Where = z.infer<typeof WhereSchema>; |
| 1079 | 1083 | |
| 1080 | 1084 | export const WhileSchema = z.object({ |
| 1081 | -}); | |
| 1085 | +}).strict(); | |
| 1082 | 1086 | export type While = z.infer<typeof WhileSchema>; |
| 1083 | 1087 | |
| 1084 | 1088 | export const WillSetSchema = z.object({ |
| 1085 | -}); | |
| 1089 | +}).strict(); | |
| 1086 | 1090 | export type WillSet = z.infer<typeof WillSetSchema>; |
| 1087 | 1091 | |
| 1088 | 1092 | export const WithSchema = z.object({ |
| 1089 | -}); | |
| 1093 | +}).strict(); | |
| 1090 | 1094 | export type With = z.infer<typeof WithSchema>; |
| 1091 | 1095 | |
| 1092 | 1096 | export const XorSchema = z.object({ |
| 1093 | -}); | |
| 1097 | +}).strict(); | |
| 1094 | 1098 | export type Xor = z.infer<typeof XorSchema>; |
| 1095 | 1099 | |
| 1096 | 1100 | export const XorEqSchema = z.object({ |
| 1097 | -}); | |
| 1101 | +}).strict(); | |
| 1098 | 1102 | export type XorEq = z.infer<typeof XorEqSchema>; |
| 1099 | 1103 | |
| 1100 | -export const YesSchema = z.object({ | |
| 1101 | -}); | |
| 1102 | -export type Yes = z.infer<typeof YesSchema>; | |
| 1103 | - | |
| 1104 | 1104 | export const YieldSchema = z.object({ |
| 1105 | -}); | |
| 1105 | +}).strict(); | |
| 1106 | 1106 | export type Yield = z.infer<typeof YieldSchema>; |
| 1107 | 1107 | |
| 1108 | 1108 | export const TopLevelSchema = z.preprocess(value => typeof value === "object" && value !== null && !Array.isArray(value) ? Object.assign(Object.create(null), value) : value, z.object({ |
| @@ -1383,5 +1383,5 @@ export const TopLevelSchema = z.preprocess(value => typeof value === "object" && | ||
| 1383 | 1383 | "xor_eq": z.union([XorEqSchema, z.number()]).optional(), |
| 1384 | 1384 | "YES": z.union([YesSchema, z.number()]).optional(), |
| 1385 | 1385 | "yield": z.union([YieldSchema, z.number()]).optional(), |
| 1386 | -})); | |
| 1386 | +}).passthrough()); | |
| 1387 | 1387 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/schema/light.schema
Mschema-typescript-zoddefault / TopLevel.ts+2 −2
| @@ -5,10 +5,10 @@ export const LightParamsSchema = z.object({ | ||
| 5 | 5 | "app_id": z.string(), |
| 6 | 6 | "outlet_id": z.string(), |
| 7 | 7 | "rgba": z.string(), |
| 8 | -}); | |
| 8 | +}).strict(); | |
| 9 | 9 | export type LightParams = z.infer<typeof LightParamsSchema>; |
| 10 | 10 | |
| 11 | 11 | export const TopLevelSchema = z.object({ |
| 12 | 12 | "LightParams": LightParamsSchema, |
| 13 | -}); | |
| 13 | +}).strict(); | |
| 14 | 14 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/list.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -7,5 +7,5 @@ export type TopLevel = { | ||
| 7 | 7 | export const TopLevelSchema: z.ZodType<TopLevel> = z.lazy(() => |
| 8 | 8 | z.object({ |
| 9 | 9 | "next": TopLevelSchema.optional(), |
| 10 | - }) | |
| 10 | + }).passthrough() | |
| 11 | 11 | ); |
Test case
1 generated file · +1 −1test/inputs/schema/min-max-items.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -7,5 +7,5 @@ export const TopLevelSchema = z.object({ | ||
| 7 | 7 | "minOnly": z.array(z.string()).min(2), |
| 8 | 8 | "plain": z.array(z.string()), |
| 9 | 9 | "unionItems": z.array(z.union([z.number().int(), z.string()])).min(2), |
| 10 | -}); | |
| 10 | +}).passthrough(); | |
| 11 | 11 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/minmax-integer.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -10,5 +10,5 @@ export const TopLevelSchema = z.object({ | ||
| 10 | 10 | "minMaxIntersection": z.number().int().min(3).max(5), |
| 11 | 11 | "minMaxUnion": z.number().int(), |
| 12 | 12 | "union": z.number().int().min(3).max(6), |
| 13 | -}); | |
| 13 | +}).passthrough(); | |
| 14 | 14 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/minmax.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -10,5 +10,5 @@ export const TopLevelSchema = z.object({ | ||
| 10 | 10 | "minMaxIntersection": z.number().min(3).max(5), |
| 11 | 11 | "minMaxUnion": z.number(), |
| 12 | 12 | "union": z.number().min(3).max(6), |
| 13 | -}); | |
| 13 | +}).passthrough(); | |
| 14 | 14 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/minmaxlength.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -10,5 +10,5 @@ export const TopLevelSchema = z.object({ | ||
| 10 | 10 | "minmaxlength": z.string().min(3).max(5), |
| 11 | 11 | "minMaxUnion": z.string(), |
| 12 | 12 | "union": z.string().min(3).max(6), |
| 13 | -}); | |
| 13 | +}).passthrough(); | |
| 14 | 14 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/multi-type-enum.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -10,5 +10,5 @@ export type FooEnum = z.infer<typeof FooEnumSchema>; | ||
| 10 | 10 | |
| 11 | 11 | export const TopLevelSchema = z.object({ |
| 12 | 12 | "foo": z.union([z.boolean(), z.number(), FooEnumSchema]), |
| 13 | -}); | |
| 13 | +}).passthrough(); | |
| 14 | 14 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/schema/mutually-recursive.schema
Mschema-typescript-zoddefault / TopLevel.ts+2 −2
| @@ -7,7 +7,7 @@ export type Bar = { | ||
| 7 | 7 | export const BarSchema: z.ZodType<Bar> = z.lazy(() => |
| 8 | 8 | z.object({ |
| 9 | 9 | "foo": z.union([z.array(TopLevelSchema), TopLevelSchema]), |
| 10 | - }) | |
| 10 | + }).passthrough() | |
| 11 | 11 | ); |
| 12 | 12 | |
| 13 | 13 | export type TopLevel = { |
| @@ -16,5 +16,5 @@ export type TopLevel = { | ||
| 16 | 16 | export const TopLevelSchema: z.ZodType<TopLevel> = z.lazy(() => |
| 17 | 17 | z.object({ |
| 18 | 18 | "bar": BarSchema.optional(), |
| 19 | - }) | |
| 19 | + }).passthrough() | |
| 20 | 20 | ); |
Test case
1 generated file · +2 −2test/inputs/schema/nested-intersection-union.schema
Mschema-typescript-zoddefault / TopLevel.ts+2 −2
| @@ -6,10 +6,10 @@ export const ItemSchema = z.object({ | ||
| 6 | 6 | "id": z.string().optional(), |
| 7 | 7 | "output": z.string().optional(), |
| 8 | 8 | "summary": z.string().optional(), |
| 9 | -}); | |
| 9 | +}).passthrough(); | |
| 10 | 10 | export type Item = z.infer<typeof ItemSchema>; |
| 11 | 11 | |
| 12 | 12 | export const TopLevelSchema = z.object({ |
| 13 | 13 | "input": z.array(ItemSchema), |
| 14 | -}); | |
| 14 | +}).strict(); | |
| 15 | 15 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/non-standard-ref.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -5,5 +5,5 @@ export const TopLevelSchema = z.object({ | ||
| 5 | 5 | "bar": z.number().int(), |
| 6 | 6 | "foo": z.number().int(), |
| 7 | 7 | "quux": z.boolean(), |
| 8 | -}); | |
| 8 | +}).passthrough(); | |
| 9 | 9 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/nullable-optional-one-of.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -10,5 +10,5 @@ export type Kind = z.infer<typeof KindSchema>; | ||
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "b": z.union([z.null(), z.string()]).optional(), |
| 12 | 12 | "kind": KindSchema, |
| 13 | -}); | |
| 13 | +}).passthrough(); | |
| 14 | 14 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/object-type-required.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -4,5 +4,5 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "foo": z.string(), |
| 6 | 6 | "bar": z.string().optional(), |
| 7 | -}); | |
| 7 | +}).passthrough(); | |
| 8 | 8 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/optional-any.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -4,5 +4,5 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "bar": z.boolean(), |
| 6 | 6 | "foo": z.any().optional(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/schema/optional-const-ref.schema
Mschema-typescript-zoddefault / TopLevel.ts+2 −2
| @@ -4,7 +4,7 @@ import * as z from "zod"; | ||
| 4 | 4 | export const CoordinateSchema = z.object({ |
| 5 | 5 | "latitude": z.number(), |
| 6 | 6 | "longitude": z.number(), |
| 7 | -}); | |
| 7 | +}).strict(); | |
| 8 | 8 | export type Coordinate = z.infer<typeof CoordinateSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.object({ |
| @@ -15,5 +15,5 @@ export const TopLevelSchema = z.object({ | ||
| 15 | 15 | "requiredCount": z.number().int().min(1).max(100), |
| 16 | 16 | "requiredLabel": z.string().min(2).max(16), |
| 17 | 17 | "weight": z.number().min(0.5).max(99.5).optional(), |
| 18 | -}); | |
| 18 | +}).strict(); | |
| 19 | 19 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/optional-constraints.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -7,5 +7,5 @@ export const TopLevelSchema = z.object({ | ||
| 7 | 7 | "optPattern": z.string().regex(new RegExp("^[a-z]+$")).optional(), |
| 8 | 8 | "optString": z.string().min(3).max(10).optional(), |
| 9 | 9 | "reqZeroMin": z.number().int().min(0).max(100), |
| 10 | -}); | |
| 10 | +}).passthrough(); | |
| 11 | 11 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/optional-date-time.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -8,5 +8,5 @@ export const TopLevelSchema = z.object({ | ||
| 8 | 8 | "required-date": z.string(), |
| 9 | 9 | "required-date-time": z.coerce.date(), |
| 10 | 10 | "required-time": z.string(), |
| 11 | -}); | |
| 11 | +}).strict(); | |
| 12 | 12 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/optional-enum.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -10,5 +10,5 @@ export type Shortcut = z.infer<typeof ShortcutSchema>; | ||
| 10 | 10 | export const TopLevelSchema = z.object({ |
| 11 | 11 | "name": z.string(), |
| 12 | 12 | "shortcut": ShortcutSchema.optional(), |
| 13 | -}); | |
| 13 | +}).strict(); | |
| 14 | 14 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/pattern.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -5,5 +5,5 @@ export const TopLevelSchema = z.object({ | ||
| 5 | 5 | "pattern1": z.string().regex(new RegExp("a[.]*")), |
| 6 | 6 | "pattern2": z.string().regex(new RegExp("b[.]*")), |
| 7 | 7 | "union": z.string().regex(new RegExp("(b[.]*)|(c[.]*)")), |
| 8 | -}); | |
| 8 | +}).passthrough(); | |
| 9 | 9 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/schema/postman-collection.schema
Mschema-typescript-zoddefault / TopLevel.ts+2 −2
| @@ -11,10 +11,10 @@ export const TopLevelSchema: z.ZodType<TopLevel> = z.lazy(() => | ||
| 11 | 11 | "item": z.array(TopLevelSchema).optional(), |
| 12 | 12 | "name": z.string().optional(), |
| 13 | 13 | "response": z.array(ResponseSchema).optional(), |
| 14 | - }) | |
| 14 | + }).passthrough() | |
| 15 | 15 | ); |
| 16 | 16 | |
| 17 | 17 | export const ResponseSchema = z.object({ |
| 18 | 18 | "body": z.string().optional(), |
| 19 | -}); | |
| 19 | +}).passthrough(); | |
| 20 | 20 | export type Response = z.infer<typeof ResponseSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/prefix-items.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -4,5 +4,5 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "open": z.array(z.union([z.boolean(), z.number().int()])), |
| 6 | 6 | "tuple": z.array(z.union([z.boolean(), z.number().int()])), |
| 7 | -}); | |
| 7 | +}).passthrough(); | |
| 8 | 8 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +10 −10test/inputs/schema/recursive-union-flattening.schema
Mschema-typescript-zoddefault / TopLevel.ts+10 −10
| @@ -1,19 +1,19 @@ | ||
| 1 | 1 | import * as z from "zod"; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -export type XClass = { | |
| 5 | - "x"?: Array<Array<any> | boolean | XClass | number | null | string> | boolean | number | Record<string, any> | null | string; | |
| 4 | +export type XObject = { | |
| 5 | + "x"?: Array<Array<any> | boolean | number | null | XObject | string> | boolean | number | Record<string, any> | null | string; | |
| 6 | 6 | }; |
| 7 | -export const XClassSchema: z.ZodType<XClass> = z.lazy(() => | |
| 7 | +export const XObjectSchema: z.ZodType<XObject> = z.lazy(() => | |
| 8 | 8 | z.object({ |
| 9 | - "x": z.union([z.null(), z.array(z.union([z.null(), z.array(z.any()), z.boolean(), XClassSchema, z.number(), z.string()])), z.boolean(), z.number(), z.record(z.string(), z.any()), z.string()]).optional(), | |
| 10 | - }) | |
| 9 | + "x": z.union([z.null(), z.array(z.union([z.null(), z.array(z.any()), z.boolean(), z.number(), XObjectSchema, z.string()])), z.boolean(), z.number(), z.record(z.string(), z.any()), z.string()]).optional(), | |
| 10 | + }).passthrough() | |
| 11 | 11 | ); |
| 12 | 12 | |
| 13 | -export const TopLevelClassSchema = z.object({ | |
| 14 | - "x": z.union([z.null(), z.array(z.union([z.null(), z.array(z.any()), z.boolean(), XClassSchema, z.number(), z.string()])), z.boolean(), z.number(), z.record(z.string(), z.any()), z.string()]).optional(), | |
| 15 | -}); | |
| 16 | -export type TopLevelClass = z.infer<typeof TopLevelClassSchema>; | |
| 13 | +export const TopLevelObjectSchema = z.object({ | |
| 14 | + "x": z.union([z.null(), z.array(z.union([z.null(), z.array(z.any()), z.boolean(), z.number(), XObjectSchema, z.string()])), z.boolean(), z.number(), z.record(z.string(), z.any()), z.string()]).optional(), | |
| 15 | +}).passthrough(); | |
| 16 | +export type TopLevelObject = z.infer<typeof TopLevelObjectSchema>; | |
| 17 | 17 | |
| 18 | -export const TopLevelSchema = z.union([z.null(), z.array(z.union([z.null(), z.array(z.any()), z.boolean(), TopLevelClassSchema, z.number(), z.string()])), z.boolean(), z.number(), z.number().int(), z.record(z.string(), z.any()), z.string()]); | |
| 18 | +export const TopLevelSchema = z.union([z.null(), z.array(z.union([z.null(), z.array(z.any()), z.boolean(), z.number(), TopLevelObjectSchema, z.string()])), z.boolean(), z.number(), z.number().int(), z.record(z.string(), z.any()), z.string()]); | |
| 19 | 19 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/ref-id-files.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -3,5 +3,5 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "foo": z.number().int(), |
| 6 | -}); | |
| 6 | +}).passthrough(); | |
| 7 | 7 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/ref-remote.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -7,5 +7,5 @@ export type TopLevel = { | ||
| 7 | 7 | export const TopLevelSchema: z.ZodType<TopLevel> = z.lazy(() => |
| 8 | 8 | z.object({ |
| 9 | 9 | "next": TopLevelSchema.optional(), |
| 10 | - }) | |
| 10 | + }).passthrough() | |
| 11 | 11 | ); |
Test case
1 generated file · +15 −15test/inputs/schema/renaming-bug.schema
Mschema-typescript-zoddefault / TopLevel.ts+15 −15
| @@ -5,9 +5,9 @@ export const AxisSchema = z.enum([ | ||
| 5 | 5 | "X", |
| 6 | 6 | "Y", |
| 7 | 7 | "Z", |
| 8 | - "XY", | |
| 9 | 8 | "YZ", |
| 10 | 9 | "ZX", |
| 10 | + "XY", | |
| 11 | 11 | ]); |
| 12 | 12 | export type Axis = z.infer<typeof AxisSchema>; |
| 13 | 13 | |
| @@ -27,53 +27,53 @@ export type Name = z.infer<typeof NameSchema>; | ||
| 27 | 27 | |
| 28 | 28 | export const ColorSchema = z.object({ |
| 29 | 29 | "rgb": z.number().optional(), |
| 30 | -}); | |
| 30 | +}).passthrough(); | |
| 31 | 31 | export type Color = z.infer<typeof ColorSchema>; |
| 32 | 32 | |
| 33 | 33 | export const CircularShapeSchema = z.object({ |
| 34 | 34 | "shapeName": z.string().optional(), |
| 35 | -}); | |
| 35 | +}).passthrough(); | |
| 36 | 36 | export type CircularShape = z.infer<typeof CircularShapeSchema>; |
| 37 | 37 | |
| 38 | 38 | export const PartSchema = z.object({ |
| 39 | 39 | "depth": z.string().optional(), |
| 40 | 40 | "length": z.string().optional(), |
| 41 | 41 | "width": z.string().optional(), |
| 42 | -}); | |
| 42 | +}).passthrough(); | |
| 43 | 43 | export type Part = z.infer<typeof PartSchema>; |
| 44 | 44 | |
| 45 | 45 | export const HistorySchema = z.object({ |
| 46 | 46 | "class": z.string().optional(), |
| 47 | -}); | |
| 47 | +}).passthrough(); | |
| 48 | 48 | export type History = z.infer<typeof HistorySchema>; |
| 49 | 49 | |
| 50 | 50 | export const LimitSchema = z.object({ |
| 51 | 51 | "maximum": z.number().optional(), |
| 52 | 52 | "minimum": z.number().optional(), |
| 53 | -}); | |
| 53 | +}).passthrough(); | |
| 54 | 54 | export type Limit = z.infer<typeof LimitSchema>; |
| 55 | 55 | |
| 56 | 56 | export const VehicleTypeSchema = z.object({ |
| 57 | 57 | "name": NameSchema.optional(), |
| 58 | 58 | "width": AxisSchema.optional(), |
| 59 | 59 | "length": AxisSchema.optional(), |
| 60 | -}); | |
| 60 | +}).passthrough(); | |
| 61 | 61 | export type VehicleType = z.infer<typeof VehicleTypeSchema>; |
| 62 | 62 | |
| 63 | 63 | export const RectShapeSchema = z.object({ |
| 64 | 64 | "parts": z.array(PartSchema).optional(), |
| 65 | -}); | |
| 65 | +}).passthrough(); | |
| 66 | 66 | export type RectShape = z.infer<typeof RectShapeSchema>; |
| 67 | 67 | |
| 68 | 68 | export const SpeedSchema = z.object({ |
| 69 | 69 | "velocity": LimitSchema.optional(), |
| 70 | -}); | |
| 70 | +}).passthrough(); | |
| 71 | 71 | export type Speed = z.infer<typeof SpeedSchema>; |
| 72 | 72 | |
| 73 | 73 | export const GeometrySchema = z.object({ |
| 74 | 74 | "rectShape": RectShapeSchema.optional(), |
| 75 | 75 | "circularShape": z.array(CircularShapeSchema).optional(), |
| 76 | -}); | |
| 76 | +}).passthrough(); | |
| 77 | 77 | export type Geometry = z.infer<typeof GeometrySchema>; |
| 78 | 78 | |
| 79 | 79 | export const VehicleSchema = z.object({ |
| @@ -83,32 +83,32 @@ export const VehicleSchema = z.object({ | ||
| 83 | 83 | "subModule": z.boolean().optional(), |
| 84 | 84 | "type": VehicleTypeSchema.optional(), |
| 85 | 85 | "year": z.string().optional(), |
| 86 | -}); | |
| 86 | +}).passthrough(); | |
| 87 | 87 | export type Vehicle = z.infer<typeof VehicleSchema>; |
| 88 | 88 | |
| 89 | 89 | export const ShapeSchema = z.object({ |
| 90 | 90 | "geometry": GeometrySchema.optional(), |
| 91 | 91 | "history": HistorySchema.optional(), |
| 92 | -}); | |
| 92 | +}).passthrough(); | |
| 93 | 93 | export type Shape = z.infer<typeof ShapeSchema>; |
| 94 | 94 | |
| 95 | 95 | export const BerrySchema = z.object({ |
| 96 | 96 | "color": ColorSchema.optional(), |
| 97 | 97 | "name": z.string().min(1).optional(), |
| 98 | 98 | "shapes": z.array(ShapeSchema).optional(), |
| 99 | -}); | |
| 99 | +}).passthrough(); | |
| 100 | 100 | export type Berry = z.infer<typeof BerrySchema>; |
| 101 | 101 | |
| 102 | 102 | export const FruitSchema = z.object({ |
| 103 | 103 | "apple": z.boolean().optional(), |
| 104 | 104 | "berries": z.array(BerrySchema).optional(), |
| 105 | 105 | "orange": z.boolean().optional(), |
| 106 | -}); | |
| 106 | +}).passthrough(); | |
| 107 | 107 | export type Fruit = z.infer<typeof FruitSchema>; |
| 108 | 108 | |
| 109 | 109 | export const TopLevelSchema = z.object({ |
| 110 | 110 | "version": z.string().regex(new RegExp("^\\d{1,5}.{1}\\d{1,5}.{1}\\d{1,5}$")).optional(), |
| 111 | 111 | "fruits": z.array(FruitSchema).optional(), |
| 112 | 112 | "vehicles": z.array(VehicleSchema).optional(), |
| 113 | -}); | |
| 113 | +}).passthrough(); | |
| 114 | 114 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/required-draft3.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -3,5 +3,5 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "longitude": z.number(), |
| 6 | -}); | |
| 6 | +}).passthrough(); | |
| 7 | 7 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/required-non-properties.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -4,5 +4,5 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "foo": z.number().int(), |
| 6 | 6 | "bar": z.any(), |
| 7 | -}); | |
| 7 | +}).passthrough(); | |
| 8 | 8 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/required.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -3,5 +3,5 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "longitude": z.number(), |
| 6 | -}); | |
| 6 | +}).passthrough(); | |
| 7 | 7 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +3 −3test/inputs/schema/rust-cycle-breaker-union.schema
Mschema-typescript-zoddefault / TopLevel.ts+3 −3
| @@ -2,18 +2,18 @@ import * as z from "zod"; | ||
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | export type Node = { |
| 5 | - "next"?: Node | null | string; | |
| 5 | + "next"?: null | Node | string; | |
| 6 | 6 | "value": string; |
| 7 | 7 | }; |
| 8 | 8 | export const NodeSchema: z.ZodType<Node> = z.lazy(() => |
| 9 | 9 | z.object({ |
| 10 | 10 | "next": z.union([z.null(), NodeSchema, z.string()]).optional(), |
| 11 | 11 | "value": z.string(), |
| 12 | - }) | |
| 12 | + }).passthrough() | |
| 13 | 13 | ); |
| 14 | 14 | |
| 15 | 15 | export const TopLevelSchema = z.object({ |
| 16 | 16 | "next": z.union([z.null(), NodeSchema, z.string()]).optional(), |
| 17 | 17 | "value": z.string(), |
| 18 | -}); | |
| 18 | +}).passthrough(); | |
| 19 | 19 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/schema-constraints.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -4,5 +4,5 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "minMaxLength": z.string().min(5).max(5), |
| 6 | 6 | "percent": z.number().min(0).max(1), |
| 7 | -}); | |
| 7 | +}).passthrough(); | |
| 8 | 8 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/simple-ref.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -7,5 +7,5 @@ export type TopLevel = { | ||
| 7 | 7 | export const TopLevelSchema: z.ZodType<TopLevel> = z.lazy(() => |
| 8 | 8 | z.object({ |
| 9 | 9 | "next": TopLevelSchema.optional(), |
| 10 | - }) | |
| 10 | + }).passthrough() | |
| 11 | 11 | ); |
Test case
1 generated file · +1 −1test/inputs/schema/strict-optional.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -3,5 +3,5 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "foo": z.union([z.null(), z.number()]), |
| 6 | -}); | |
| 6 | +}).passthrough(); | |
| 7 | 7 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/top-level-array.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -4,7 +4,7 @@ import * as z from "zod"; | ||
| 4 | 4 | export const TextClassificationOutputElementSchema = z.object({ |
| 5 | 5 | "label": z.string(), |
| 6 | 6 | "score": z.number(), |
| 7 | -}); | |
| 7 | +}).passthrough(); | |
| 8 | 8 | export type TextClassificationOutputElement = z.infer<typeof TextClassificationOutputElementSchema>; |
| 9 | 9 | |
| 10 | 10 | export const TopLevelSchema = z.array(TextClassificationOutputElementSchema); |
Test case
1 generated file · +1 −1test/inputs/schema/tuple.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -3,5 +3,5 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "tuple": z.array(z.union([z.boolean(), z.number().int()])), |
| 6 | -}); | |
| 6 | +}).passthrough(); | |
| 7 | 7 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +4 −4test/inputs/schema/unevaluated-properties.schema
Mschema-typescript-zoddefault / TopLevel.ts+4 −4
| @@ -2,23 +2,23 @@ import * as z from "zod"; | ||
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | export const ClosedClassSchema = z.object({ |
| 5 | -}); | |
| 5 | +}).strict(); | |
| 6 | 6 | export type ClosedClass = z.infer<typeof ClosedClassSchema>; |
| 7 | 7 | |
| 8 | 8 | export const ItemSchema = z.object({ |
| 9 | 9 | "key": z.string(), |
| 10 | 10 | "value": z.string(), |
| 11 | -}); | |
| 11 | +}).passthrough(); | |
| 12 | 12 | export type Item = z.infer<typeof ItemSchema>; |
| 13 | 13 | |
| 14 | 14 | export const ConfigSchema = z.object({ |
| 15 | 15 | "closed": z.union([z.null(), z.array(z.any()), z.boolean(), ClosedClassSchema, z.number(), z.number().int(), z.string()]).optional(), |
| 16 | 16 | "name": z.string().optional(), |
| 17 | 17 | "settings": z.record(z.string(), z.array(ItemSchema)).optional(), |
| 18 | -}); | |
| 18 | +}).passthrough(); | |
| 19 | 19 | export type Config = z.infer<typeof ConfigSchema>; |
| 20 | 20 | |
| 21 | 21 | export const TopLevelSchema = z.object({ |
| 22 | 22 | "config": ConfigSchema.optional(), |
| 23 | -}); | |
| 23 | +}).passthrough(); | |
| 24 | 24 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/union-int-double.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -3,5 +3,5 @@ import * as z from "zod"; | ||
| 3 | 3 | |
| 4 | 4 | export const TopLevelSchema = z.object({ |
| 5 | 5 | "value": z.union([z.number(), z.string()]), |
| 6 | -}); | |
| 6 | +}).passthrough(); | |
| 7 | 7 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +2 −2test/inputs/schema/union-list.schema
Mschema-typescript-zoddefault / TopLevel.ts+2 −2
| @@ -7,10 +7,10 @@ export type UnionListClass = { | ||
| 7 | 7 | export const UnionListClassSchema: z.ZodType<UnionListClass> = z.lazy(() => |
| 8 | 8 | z.object({ |
| 9 | 9 | "next": z.union([UnionListClassSchema, z.number()]), |
| 10 | - }) | |
| 10 | + }).strict() | |
| 11 | 11 | ); |
| 12 | 12 | |
| 13 | 13 | export const TopLevelSchema = z.object({ |
| 14 | 14 | "list": z.union([UnionListClassSchema, z.number()]), |
| 15 | -}); | |
| 15 | +}).strict(); | |
| 16 | 16 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +1 −1test/inputs/schema/union.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -5,7 +5,7 @@ export const TopLevelElementSchema = z.object({ | ||
| 5 | 5 | "one": z.number().int().optional(), |
| 6 | 6 | "two": z.boolean(), |
| 7 | 7 | "three": z.number().optional(), |
| 8 | -}); | |
| 8 | +}).passthrough(); | |
| 9 | 9 | export type TopLevelElement = z.infer<typeof TopLevelElementSchema>; |
| 10 | 10 | |
| 11 | 11 | export const TopLevelSchema = z.array(TopLevelElementSchema); |
Test case
1 generated file · +1 −1test/inputs/schema/uuid.schema
Mschema-typescript-zoddefault / TopLevel.ts+1 −1
| @@ -13,5 +13,5 @@ export const TopLevelSchema = z.object({ | ||
| 13 | 13 | "one": z.string().uuid(), |
| 14 | 14 | "optional": z.string().uuid().optional(), |
| 15 | 15 | "unionWithEnum": z.union([UnionWithEnumEnumSchema, z.string().uuid()]), |
| 16 | -}); | |
| 16 | +}).passthrough(); | |
| 17 | 17 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
Test case
1 generated file · +132 −105test/inputs/schema/vega-lite.schema
Mschema-typescript-zoddefault / TopLevel.ts+132 −105
| @@ -597,7 +597,7 @@ export const SelectionSchema: z.ZodType<Selection> = z.lazy(() => | ||
| 597 | 597 | "not": z.union([SelectionSchema, z.string()]).optional(), |
| 598 | 598 | "and": z.array(z.union([SelectionSchema, z.string()])).optional(), |
| 599 | 599 | "or": z.array(z.union([SelectionSchema, z.string()])).optional(), |
| 600 | - }) | |
| 600 | + }).strict() | |
| 601 | 601 | ); |
| 602 | 602 | |
| 603 | 603 | export type Predicate = { |
| @@ -622,7 +622,7 @@ export const PredicateSchema: z.ZodType<Predicate> = z.lazy(() => | ||
| 622 | 622 | "range": z.array(z.union([z.null(), DateTimeSchema, z.number()])).min(2).max(2).optional(), |
| 623 | 623 | "oneOf": z.array(z.union([z.boolean(), DateTimeSchema, z.number(), z.string()])).optional(), |
| 624 | 624 | "selection": z.union([SelectionSchema, z.string()]).optional(), |
| 625 | - }) | |
| 625 | + }).strict() | |
| 626 | 626 | ); |
| 627 | 627 | |
| 628 | 628 | export type Spec = { |
| @@ -665,7 +665,7 @@ export const SpecSchema: z.ZodType<Spec> = z.lazy(() => | ||
| 665 | 665 | "repeat": RepeatSchema.optional(), |
| 666 | 666 | "vconcat": z.array(SpecSchema).optional(), |
| 667 | 667 | "hconcat": z.array(SpecSchema).optional(), |
| 668 | - }) | |
| 668 | + }).strict() | |
| 669 | 669 | ); |
| 670 | 670 | |
| 671 | 671 | export type LayerSpec = { |
| @@ -698,14 +698,14 @@ export const LayerSpecSchema: z.ZodType<LayerSpec> = z.lazy(() => | ||
| 698 | 698 | "mark": z.union([MarkDefSchema, MarkSchema]).optional(), |
| 699 | 699 | "projection": ProjectionSchema.optional(), |
| 700 | 700 | "selection": z.record(z.string(), SelectionDefSchema).optional(), |
| 701 | - }) | |
| 701 | + }).strict() | |
| 702 | 702 | ); |
| 703 | 703 | |
| 704 | 704 | export const AutoSizeParamsSchema = z.object({ |
| 705 | 705 | "contains": ContainsSchema.optional(), |
| 706 | 706 | "resize": z.boolean().optional(), |
| 707 | 707 | "type": AutosizeTypeSchema.optional(), |
| 708 | -}); | |
| 708 | +}).strict(); | |
| 709 | 709 | export type AutoSizeParams = z.infer<typeof AutoSizeParamsSchema>; |
| 710 | 710 | |
| 711 | 711 | export const MarkConfigSchema = z.object({ |
| @@ -739,7 +739,7 @@ export const MarkConfigSchema = z.object({ | ||
| 739 | 739 | "tension": z.number().min(0).max(1).optional(), |
| 740 | 740 | "text": z.string().optional(), |
| 741 | 741 | "theta": z.number().optional(), |
| 742 | -}); | |
| 742 | +}).strict(); | |
| 743 | 743 | export type MarkConfig = z.infer<typeof MarkConfigSchema>; |
| 744 | 744 | |
| 745 | 745 | export const AxisConfigSchema = z.object({ |
| @@ -782,7 +782,7 @@ export const AxisConfigSchema = z.object({ | ||
| 782 | 782 | "titlePadding": z.number().optional(), |
| 783 | 783 | "titleX": z.number().optional(), |
| 784 | 784 | "titleY": z.number().optional(), |
| 785 | -}); | |
| 785 | +}).strict(); | |
| 786 | 786 | export type AxisConfig = z.infer<typeof AxisConfigSchema>; |
| 787 | 787 | |
| 788 | 788 | export const VgAxisConfigSchema = z.object({ |
| @@ -824,7 +824,7 @@ export const VgAxisConfigSchema = z.object({ | ||
| 824 | 824 | "titlePadding": z.number().optional(), |
| 825 | 825 | "titleX": z.number().optional(), |
| 826 | 826 | "titleY": z.number().optional(), |
| 827 | -}); | |
| 827 | +}).strict(); | |
| 828 | 828 | export type VgAxisConfig = z.infer<typeof VgAxisConfigSchema>; |
| 829 | 829 | |
| 830 | 830 | export const BarConfigSchema = z.object({ |
| @@ -861,7 +861,7 @@ export const BarConfigSchema = z.object({ | ||
| 861 | 861 | "tension": z.number().min(0).max(1).optional(), |
| 862 | 862 | "text": z.string().optional(), |
| 863 | 863 | "theta": z.number().optional(), |
| 864 | -}); | |
| 864 | +}).strict(); | |
| 865 | 865 | export type BarConfig = z.infer<typeof BarConfigSchema>; |
| 866 | 866 | |
| 867 | 867 | export const LegendConfigSchema = z.object({ |
| @@ -901,7 +901,7 @@ export const LegendConfigSchema = z.object({ | ||
| 901 | 901 | "titleFontWeight": z.union([z.number(), z.string()]).optional(), |
| 902 | 902 | "titleLimit": z.number().optional(), |
| 903 | 903 | "titlePadding": z.number().optional(), |
| 904 | -}); | |
| 904 | +}).strict(); | |
| 905 | 905 | export type LegendConfig = z.infer<typeof LegendConfigSchema>; |
| 906 | 906 | |
| 907 | 907 | export const PaddingClassSchema = z.object({ |
| @@ -909,35 +909,28 @@ export const PaddingClassSchema = z.object({ | ||
| 909 | 909 | "left": z.number().optional(), |
| 910 | 910 | "right": z.number().optional(), |
| 911 | 911 | "top": z.number().optional(), |
| 912 | -}); | |
| 912 | +}).strict(); | |
| 913 | 913 | export type PaddingClass = z.infer<typeof PaddingClassSchema>; |
| 914 | 914 | |
| 915 | -export const ProjectionConfigSchema = z.object({ | |
| 916 | - "center": z.array(z.number()).optional(), | |
| 917 | - "clipAngle": z.number().optional(), | |
| 918 | - "clipExtent": z.array(z.array(z.number())).optional(), | |
| 919 | - "coefficient": z.number().optional(), | |
| 920 | - "distance": z.number().optional(), | |
| 921 | - "fraction": z.number().optional(), | |
| 922 | - "lobes": z.number().optional(), | |
| 923 | - "parallel": z.number().optional(), | |
| 924 | - "precision": z.record(z.string(), z.union([z.number(), z.string()])).optional(), | |
| 925 | - "radius": z.number().optional(), | |
| 926 | - "ratio": z.number().optional(), | |
| 927 | - "rotate": z.array(z.number()).optional(), | |
| 928 | - "spacing": z.number().optional(), | |
| 929 | - "tilt": z.number().optional(), | |
| 930 | - "type": VgProjectionTypeSchema.optional(), | |
| 931 | -}); | |
| 932 | -export type ProjectionConfig = z.infer<typeof ProjectionConfigSchema>; | |
| 915 | +export const PurplePrecisionSchema = z.object({ | |
| 916 | + "length": z.number(), | |
| 917 | +}).catchall(z.string()); | |
| 918 | +export type PurplePrecision = z.infer<typeof PurplePrecisionSchema>; | |
| 933 | 919 | |
| 934 | -export const VgSchemeSchema = z.object({ | |
| 920 | +export const CategoryVgSchemeSchema = z.object({ | |
| 921 | + "count": z.number().optional(), | |
| 922 | + "extent": z.array(z.number()).optional(), | |
| 923 | + "scheme": z.string(), | |
| 924 | +}).strict(); | |
| 925 | +export type CategoryVgScheme = z.infer<typeof CategoryVgSchemeSchema>; | |
| 926 | + | |
| 927 | +export const RangeConfigValueVgSchemeSchema = z.object({ | |
| 935 | 928 | "count": z.number().optional(), |
| 936 | 929 | "extent": z.array(z.number()).optional(), |
| 937 | 930 | "scheme": z.string().optional(), |
| 938 | 931 | "step": z.number().optional(), |
| 939 | -}); | |
| 940 | -export type VgScheme = z.infer<typeof VgSchemeSchema>; | |
| 932 | +}).strict(); | |
| 933 | +export type RangeConfigValueVgScheme = z.infer<typeof RangeConfigValueVgSchemeSchema>; | |
| 941 | 934 | |
| 942 | 935 | export const ScaleConfigSchema = z.object({ |
| 943 | 936 | "bandPaddingInner": z.number().min(0).max(1).optional(), |
| @@ -959,7 +952,7 @@ export const ScaleConfigSchema = z.object({ | ||
| 959 | 952 | "round": z.boolean().optional(), |
| 960 | 953 | "textXRangeStep": z.number().min(0).optional(), |
| 961 | 954 | "useUnaggregatedDomain": z.boolean().optional(), |
| 962 | -}); | |
| 955 | +}).strict(); | |
| 963 | 956 | export type ScaleConfig = z.infer<typeof ScaleConfigSchema>; |
| 964 | 957 | |
| 965 | 958 | export const BrushConfigSchema = z.object({ |
| @@ -970,7 +963,7 @@ export const BrushConfigSchema = z.object({ | ||
| 970 | 963 | "strokeDashOffset": z.number().optional(), |
| 971 | 964 | "strokeOpacity": z.number().optional(), |
| 972 | 965 | "strokeWidth": z.number().optional(), |
| 973 | -}); | |
| 966 | +}).strict(); | |
| 974 | 967 | export type BrushConfig = z.infer<typeof BrushConfigSchema>; |
| 975 | 968 | |
| 976 | 969 | export const MultiSelectionConfigSchema = z.object({ |
| @@ -981,7 +974,7 @@ export const MultiSelectionConfigSchema = z.object({ | ||
| 981 | 974 | "on": z.any().optional(), |
| 982 | 975 | "resolve": SelectionResolutionSchema.optional(), |
| 983 | 976 | "toggle": z.union([z.boolean(), z.string()]).optional(), |
| 984 | -}); | |
| 977 | +}).strict(); | |
| 985 | 978 | export type MultiSelectionConfig = z.infer<typeof MultiSelectionConfigSchema>; |
| 986 | 979 | |
| 987 | 980 | export const VgBindingSchema = z.object({ |
| @@ -991,7 +984,7 @@ export const VgBindingSchema = z.object({ | ||
| 991 | 984 | "max": z.number().optional(), |
| 992 | 985 | "min": z.number().optional(), |
| 993 | 986 | "step": z.number().optional(), |
| 994 | -}); | |
| 987 | +}).strict(); | |
| 995 | 988 | export type VgBinding = z.infer<typeof VgBindingSchema>; |
| 996 | 989 | |
| 997 | 990 | export const VgMarkConfigSchema = z.object({ |
| @@ -1023,7 +1016,7 @@ export const VgMarkConfigSchema = z.object({ | ||
| 1023 | 1016 | "tension": z.number().min(0).max(1).optional(), |
| 1024 | 1017 | "text": z.string().optional(), |
| 1025 | 1018 | "theta": z.number().optional(), |
| 1026 | -}); | |
| 1019 | +}).strict(); | |
| 1027 | 1020 | export type VgMarkConfig = z.infer<typeof VgMarkConfigSchema>; |
| 1028 | 1021 | |
| 1029 | 1022 | export const TextConfigSchema = z.object({ |
| @@ -1058,7 +1051,7 @@ export const TextConfigSchema = z.object({ | ||
| 1058 | 1051 | "tension": z.number().min(0).max(1).optional(), |
| 1059 | 1052 | "text": z.string().optional(), |
| 1060 | 1053 | "theta": z.number().optional(), |
| 1061 | -}); | |
| 1054 | +}).strict(); | |
| 1062 | 1055 | export type TextConfig = z.infer<typeof TextConfigSchema>; |
| 1063 | 1056 | |
| 1064 | 1057 | export const TickConfigSchema = z.object({ |
| @@ -1094,7 +1087,7 @@ export const TickConfigSchema = z.object({ | ||
| 1094 | 1087 | "text": z.string().optional(), |
| 1095 | 1088 | "theta": z.number().optional(), |
| 1096 | 1089 | "thickness": z.number().min(0).optional(), |
| 1097 | -}); | |
| 1090 | +}).strict(); | |
| 1098 | 1091 | export type TickConfig = z.infer<typeof TickConfigSchema>; |
| 1099 | 1092 | |
| 1100 | 1093 | export const VgTitleConfigSchema = z.object({ |
| @@ -1108,7 +1101,7 @@ export const VgTitleConfigSchema = z.object({ | ||
| 1108 | 1101 | "limit": z.number().min(0).optional(), |
| 1109 | 1102 | "offset": z.number().optional(), |
| 1110 | 1103 | "orient": TitleOrientSchema.optional(), |
| 1111 | -}); | |
| 1104 | +}).strict(); | |
| 1112 | 1105 | export type VgTitleConfig = z.infer<typeof VgTitleConfigSchema>; |
| 1113 | 1106 | |
| 1114 | 1107 | export const ViewConfigSchema = z.object({ |
| @@ -1122,7 +1115,7 @@ export const ViewConfigSchema = z.object({ | ||
| 1122 | 1115 | "strokeOpacity": z.number().optional(), |
| 1123 | 1116 | "strokeWidth": z.number().optional(), |
| 1124 | 1117 | "width": z.number().optional(), |
| 1125 | -}); | |
| 1118 | +}).strict(); | |
| 1126 | 1119 | export type ViewConfig = z.infer<typeof ViewConfigSchema>; |
| 1127 | 1120 | |
| 1128 | 1121 | export const DataFormatSchema = z.object({ |
| @@ -1131,7 +1124,7 @@ export const DataFormatSchema = z.object({ | ||
| 1131 | 1124 | "property": z.string().optional(), |
| 1132 | 1125 | "feature": z.string().optional(), |
| 1133 | 1126 | "mesh": z.string().optional(), |
| 1134 | -}); | |
| 1127 | +}).strict(); | |
| 1135 | 1128 | export type DataFormat = z.infer<typeof DataFormatSchema>; |
| 1136 | 1129 | |
| 1137 | 1130 | export const BinParamsSchema = z.object({ |
| @@ -1143,14 +1136,14 @@ export const BinParamsSchema = z.object({ | ||
| 1143 | 1136 | "nice": z.boolean().optional(), |
| 1144 | 1137 | "step": z.number().optional(), |
| 1145 | 1138 | "steps": z.array(z.number()).min(1).optional(), |
| 1146 | -}); | |
| 1139 | +}).strict(); | |
| 1147 | 1140 | export type BinParams = z.infer<typeof BinParamsSchema>; |
| 1148 | 1141 | |
| 1149 | 1142 | export const ConditionalValueDefSchema = z.object({ |
| 1150 | 1143 | "test": z.union([PredicateSchema, z.string()]).optional(), |
| 1151 | 1144 | "value": z.union([z.boolean(), z.number(), z.string()]), |
| 1152 | 1145 | "selection": z.union([SelectionSchema, z.string()]).optional(), |
| 1153 | -}); | |
| 1146 | +}).strict(); | |
| 1154 | 1147 | export type ConditionalValueDef = z.infer<typeof ConditionalValueDefSchema>; |
| 1155 | 1148 | |
| 1156 | 1149 | export const DateTimeSchema = z.object({ |
| @@ -1164,12 +1157,12 @@ export const DateTimeSchema = z.object({ | ||
| 1164 | 1157 | "seconds": z.number().min(0).max(59).optional(), |
| 1165 | 1158 | "utc": z.boolean().optional(), |
| 1166 | 1159 | "year": z.number().optional(), |
| 1167 | -}); | |
| 1160 | +}).strict(); | |
| 1168 | 1161 | export type DateTime = z.infer<typeof DateTimeSchema>; |
| 1169 | 1162 | |
| 1170 | 1163 | export const RepeatRefSchema = z.object({ |
| 1171 | 1164 | "repeat": RepeatEnumSchema, |
| 1172 | -}); | |
| 1165 | +}).strict(); | |
| 1173 | 1166 | export type RepeatRef = z.infer<typeof RepeatRefSchema>; |
| 1174 | 1167 | |
| 1175 | 1168 | export const LegendSchema = z.object({ |
| @@ -1183,46 +1176,46 @@ export const LegendSchema = z.object({ | ||
| 1183 | 1176 | "type": LegendTypeSchema.optional(), |
| 1184 | 1177 | "values": z.array(z.union([DateTimeSchema, z.number(), z.string()])).optional(), |
| 1185 | 1178 | "zindex": z.number().min(0).optional(), |
| 1186 | -}); | |
| 1179 | +}).strict(); | |
| 1187 | 1180 | export type Legend = z.infer<typeof LegendSchema>; |
| 1188 | 1181 | |
| 1189 | 1182 | export const DomainClassSchema = z.object({ |
| 1190 | 1183 | "field": z.string().optional(), |
| 1191 | 1184 | "selection": z.string(), |
| 1192 | 1185 | "encoding": z.string().optional(), |
| 1193 | -}); | |
| 1186 | +}).strict(); | |
| 1194 | 1187 | export type DomainClass = z.infer<typeof DomainClassSchema>; |
| 1195 | 1188 | |
| 1196 | 1189 | export const InterpolateParamsSchema = z.object({ |
| 1197 | 1190 | "gamma": z.number().optional(), |
| 1198 | 1191 | "type": InterpolateParamsTypeSchema, |
| 1199 | -}); | |
| 1192 | +}).strict(); | |
| 1200 | 1193 | export type InterpolateParams = z.infer<typeof InterpolateParamsSchema>; |
| 1201 | 1194 | |
| 1202 | 1195 | export const NiceClassSchema = z.object({ |
| 1203 | 1196 | "interval": z.string(), |
| 1204 | 1197 | "step": z.number(), |
| 1205 | -}); | |
| 1198 | +}).strict(); | |
| 1206 | 1199 | export type NiceClass = z.infer<typeof NiceClassSchema>; |
| 1207 | 1200 | |
| 1208 | 1201 | export const SchemeParamsSchema = z.object({ |
| 1209 | 1202 | "extent": z.array(z.number()).optional(), |
| 1210 | 1203 | "name": z.string(), |
| 1211 | -}); | |
| 1204 | +}).strict(); | |
| 1212 | 1205 | export type SchemeParams = z.infer<typeof SchemeParamsSchema>; |
| 1213 | 1206 | |
| 1214 | 1207 | export const SortFieldSchema = z.object({ |
| 1215 | 1208 | "field": z.union([RepeatRefSchema, z.string()]).optional(), |
| 1216 | 1209 | "op": AggregateOpSchema, |
| 1217 | 1210 | "order": z.union([z.null(), SortEnumSchema]).optional(), |
| 1218 | -}); | |
| 1211 | +}).strict(); | |
| 1219 | 1212 | export type SortField = z.infer<typeof SortFieldSchema>; |
| 1220 | 1213 | |
| 1221 | 1214 | export const HeaderSchema = z.object({ |
| 1222 | 1215 | "format": z.string().optional(), |
| 1223 | 1216 | "labelAngle": z.number().min(-360).max(360).optional(), |
| 1224 | 1217 | "title": z.union([z.null(), z.string()]).optional(), |
| 1225 | -}); | |
| 1218 | +}).strict(); | |
| 1226 | 1219 | export type Header = z.infer<typeof HeaderSchema>; |
| 1227 | 1220 | |
| 1228 | 1221 | export const FieldDefSchema = z.object({ |
| @@ -1231,7 +1224,7 @@ export const FieldDefSchema = z.object({ | ||
| 1231 | 1224 | "field": z.union([RepeatRefSchema, z.string()]).optional(), |
| 1232 | 1225 | "timeUnit": TimeUnitSchema.optional(), |
| 1233 | 1226 | "type": TypeSchema, |
| 1234 | -}); | |
| 1227 | +}).strict(); | |
| 1235 | 1228 | export type FieldDef = z.infer<typeof FieldDefSchema>; |
| 1236 | 1229 | |
| 1237 | 1230 | export const ConditionalPredicateFieldDefClassSchema = z.object({ |
| @@ -1243,7 +1236,7 @@ export const ConditionalPredicateFieldDefClassSchema = z.object({ | ||
| 1243 | 1236 | "field": z.union([RepeatRefSchema, z.string()]).optional(), |
| 1244 | 1237 | "timeUnit": TimeUnitSchema.optional(), |
| 1245 | 1238 | "type": TypeSchema.optional(), |
| 1246 | -}); | |
| 1239 | +}).strict(); | |
| 1247 | 1240 | export type ConditionalPredicateFieldDefClass = z.infer<typeof ConditionalPredicateFieldDefClassSchema>; |
| 1248 | 1241 | |
| 1249 | 1242 | export const OrderFieldDefSchema = z.object({ |
| @@ -1253,7 +1246,7 @@ export const OrderFieldDefSchema = z.object({ | ||
| 1253 | 1246 | "sort": z.union([z.null(), SortEnumSchema]).optional(), |
| 1254 | 1247 | "timeUnit": TimeUnitSchema.optional(), |
| 1255 | 1248 | "type": TypeSchema, |
| 1256 | -}); | |
| 1249 | +}).strict(); | |
| 1257 | 1250 | export type OrderFieldDef = z.infer<typeof OrderFieldDefSchema>; |
| 1258 | 1251 | |
| 1259 | 1252 | export const ConditionalPredicateTextFieldDefClassSchema = z.object({ |
| @@ -1266,7 +1259,7 @@ export const ConditionalPredicateTextFieldDefClassSchema = z.object({ | ||
| 1266 | 1259 | "format": z.string().optional(), |
| 1267 | 1260 | "timeUnit": TimeUnitSchema.optional(), |
| 1268 | 1261 | "type": TypeSchema.optional(), |
| 1269 | -}); | |
| 1262 | +}).strict(); | |
| 1270 | 1263 | export type ConditionalPredicateTextFieldDefClass = z.infer<typeof ConditionalPredicateTextFieldDefClassSchema>; |
| 1271 | 1264 | |
| 1272 | 1265 | export const AxisSchema = z.object({ |
| @@ -1292,7 +1285,7 @@ export const AxisSchema = z.object({ | ||
| 1292 | 1285 | "titlePadding": z.number().optional(), |
| 1293 | 1286 | "values": z.array(z.union([DateTimeSchema, z.number()])).optional(), |
| 1294 | 1287 | "zindex": z.number().min(0).optional(), |
| 1295 | -}); | |
| 1288 | +}).strict(); | |
| 1296 | 1289 | export type Axis = z.infer<typeof AxisSchema>; |
| 1297 | 1290 | |
| 1298 | 1291 | export const X2ClassSchema = z.object({ |
| @@ -1302,7 +1295,7 @@ export const X2ClassSchema = z.object({ | ||
| 1302 | 1295 | "timeUnit": TimeUnitSchema.optional(), |
| 1303 | 1296 | "type": TypeSchema.optional(), |
| 1304 | 1297 | "value": z.union([z.boolean(), z.number(), z.string()]).optional(), |
| 1305 | -}); | |
| 1298 | +}).strict(); | |
| 1306 | 1299 | export type X2Class = z.infer<typeof X2ClassSchema>; |
| 1307 | 1300 | |
| 1308 | 1301 | export const MarkDefSchema = z.object({ |
| @@ -1339,32 +1332,18 @@ export const MarkDefSchema = z.object({ | ||
| 1339 | 1332 | "text": z.string().optional(), |
| 1340 | 1333 | "theta": z.number().optional(), |
| 1341 | 1334 | "type": MarkSchema, |
| 1342 | -}); | |
| 1335 | +}).strict(); | |
| 1343 | 1336 | export type MarkDef = z.infer<typeof MarkDefSchema>; |
| 1344 | 1337 | |
| 1345 | -export const ProjectionSchema = z.object({ | |
| 1346 | - "center": z.array(z.number()).optional(), | |
| 1347 | - "clipAngle": z.number().optional(), | |
| 1348 | - "clipExtent": z.array(z.array(z.number())).optional(), | |
| 1349 | - "coefficient": z.number().optional(), | |
| 1350 | - "distance": z.number().optional(), | |
| 1351 | - "fraction": z.number().optional(), | |
| 1352 | - "lobes": z.number().optional(), | |
| 1353 | - "parallel": z.number().optional(), | |
| 1354 | - "precision": z.record(z.string(), z.union([z.number(), z.string()])).optional(), | |
| 1355 | - "radius": z.number().optional(), | |
| 1356 | - "ratio": z.number().optional(), | |
| 1357 | - "rotate": z.array(z.number()).optional(), | |
| 1358 | - "spacing": z.number().optional(), | |
| 1359 | - "tilt": z.number().optional(), | |
| 1360 | - "type": VgProjectionTypeSchema.optional(), | |
| 1361 | -}); | |
| 1362 | -export type Projection = z.infer<typeof ProjectionSchema>; | |
| 1338 | +export const FluffyPrecisionSchema = z.object({ | |
| 1339 | + "length": z.number(), | |
| 1340 | +}).catchall(z.string()); | |
| 1341 | +export type FluffyPrecision = z.infer<typeof FluffyPrecisionSchema>; | |
| 1363 | 1342 | |
| 1364 | 1343 | export const AxisResolveMapSchema = z.object({ |
| 1365 | 1344 | "x": ResolveModeSchema.optional(), |
| 1366 | 1345 | "y": ResolveModeSchema.optional(), |
| 1367 | -}); | |
| 1346 | +}).strict(); | |
| 1368 | 1347 | export type AxisResolveMap = z.infer<typeof AxisResolveMapSchema>; |
| 1369 | 1348 | |
| 1370 | 1349 | export const LegendResolveMapSchema = z.object({ |
| @@ -1372,7 +1351,7 @@ export const LegendResolveMapSchema = z.object({ | ||
| 1372 | 1351 | "opacity": ResolveModeSchema.optional(), |
| 1373 | 1352 | "shape": ResolveModeSchema.optional(), |
| 1374 | 1353 | "size": ResolveModeSchema.optional(), |
| 1375 | -}); | |
| 1354 | +}).strict(); | |
| 1376 | 1355 | export type LegendResolveMap = z.infer<typeof LegendResolveMapSchema>; |
| 1377 | 1356 | |
| 1378 | 1357 | export const ScaleResolveMapSchema = z.object({ |
| @@ -1382,7 +1361,7 @@ export const ScaleResolveMapSchema = z.object({ | ||
| 1382 | 1361 | "size": ResolveModeSchema.optional(), |
| 1383 | 1362 | "x": ResolveModeSchema.optional(), |
| 1384 | 1363 | "y": ResolveModeSchema.optional(), |
| 1385 | -}); | |
| 1364 | +}).strict(); | |
| 1386 | 1365 | export type ScaleResolveMap = z.infer<typeof ScaleResolveMapSchema>; |
| 1387 | 1366 | |
| 1388 | 1367 | export const SelectionDefSchema = z.object({ |
| @@ -1398,7 +1377,7 @@ export const SelectionDefSchema = z.object({ | ||
| 1398 | 1377 | "mark": BrushConfigSchema.optional(), |
| 1399 | 1378 | "translate": z.union([z.boolean(), z.string()]).optional(), |
| 1400 | 1379 | "zoom": z.union([z.boolean(), z.string()]).optional(), |
| 1401 | -}); | |
| 1380 | +}).strict(); | |
| 1402 | 1381 | export type SelectionDef = z.infer<typeof SelectionDefSchema>; |
| 1403 | 1382 | |
| 1404 | 1383 | export const TitleParamsSchema = z.object({ |
| @@ -1407,22 +1386,51 @@ export const TitleParamsSchema = z.object({ | ||
| 1407 | 1386 | "orient": TitleOrientSchema.optional(), |
| 1408 | 1387 | "style": z.union([z.array(z.string()), z.string()]).optional(), |
| 1409 | 1388 | "text": z.string(), |
| 1410 | -}); | |
| 1389 | +}).strict(); | |
| 1411 | 1390 | export type TitleParams = z.infer<typeof TitleParamsSchema>; |
| 1412 | 1391 | |
| 1413 | 1392 | export const AggregatedFieldDefSchema = z.object({ |
| 1414 | 1393 | "as": z.string(), |
| 1415 | 1394 | "field": z.string(), |
| 1416 | 1395 | "op": AggregateOpSchema, |
| 1417 | -}); | |
| 1396 | +}).strict(); | |
| 1418 | 1397 | export type AggregatedFieldDef = z.infer<typeof AggregatedFieldDefSchema>; |
| 1419 | 1398 | |
| 1420 | 1399 | export const RepeatSchema = z.object({ |
| 1421 | 1400 | "column": z.array(z.string()).optional(), |
| 1422 | 1401 | "row": z.array(z.string()).optional(), |
| 1423 | -}); | |
| 1402 | +}).strict(); | |
| 1424 | 1403 | export type Repeat = z.infer<typeof RepeatSchema>; |
| 1425 | 1404 | |
| 1405 | +export const ProjectionConfigSchema = z.object({ | |
| 1406 | + "center": z.array(z.number()).optional(), | |
| 1407 | + "clipAngle": z.number().optional(), | |
| 1408 | + "clipExtent": z.array(z.array(z.number())).optional(), | |
| 1409 | + "coefficient": z.number().optional(), | |
| 1410 | + "distance": z.number().optional(), | |
| 1411 | + "fraction": z.number().optional(), | |
| 1412 | + "lobes": z.number().optional(), | |
| 1413 | + "parallel": z.number().optional(), | |
| 1414 | + "precision": PurplePrecisionSchema.optional(), | |
| 1415 | + "radius": z.number().optional(), | |
| 1416 | + "ratio": z.number().optional(), | |
| 1417 | + "rotate": z.array(z.number()).optional(), | |
| 1418 | + "spacing": z.number().optional(), | |
| 1419 | + "tilt": z.number().optional(), | |
| 1420 | + "type": VgProjectionTypeSchema.optional(), | |
| 1421 | +}).strict(); | |
| 1422 | +export type ProjectionConfig = z.infer<typeof ProjectionConfigSchema>; | |
| 1423 | + | |
| 1424 | +export const RangeConfigSchema = z.object({ | |
| 1425 | + "category": z.union([z.array(z.string()), CategoryVgSchemeSchema]).optional(), | |
| 1426 | + "diverging": z.union([z.array(z.string()), CategoryVgSchemeSchema]).optional(), | |
| 1427 | + "heatmap": z.union([z.array(z.string()), CategoryVgSchemeSchema]).optional(), | |
| 1428 | + "ordinal": z.union([z.array(z.string()), CategoryVgSchemeSchema]).optional(), | |
| 1429 | + "ramp": z.union([z.array(z.string()), CategoryVgSchemeSchema]).optional(), | |
| 1430 | + "symbol": z.array(z.string()).optional(), | |
| 1431 | +}).catchall(z.union([z.array(z.union([z.number(), z.string()])), RangeConfigValueVgSchemeSchema])); | |
| 1432 | +export type RangeConfig = z.infer<typeof RangeConfigSchema>; | |
| 1433 | + | |
| 1426 | 1434 | export const IntervalSelectionConfigSchema = z.object({ |
| 1427 | 1435 | "bind": BindEnumSchema.optional(), |
| 1428 | 1436 | "empty": EmptySchema.optional(), |
| @@ -1433,7 +1441,7 @@ export const IntervalSelectionConfigSchema = z.object({ | ||
| 1433 | 1441 | "resolve": SelectionResolutionSchema.optional(), |
| 1434 | 1442 | "translate": z.union([z.boolean(), z.string()]).optional(), |
| 1435 | 1443 | "zoom": z.union([z.boolean(), z.string()]).optional(), |
| 1436 | -}); | |
| 1444 | +}).strict(); | |
| 1437 | 1445 | export type IntervalSelectionConfig = z.infer<typeof IntervalSelectionConfigSchema>; |
| 1438 | 1446 | |
| 1439 | 1447 | export const SingleSelectionConfigSchema = z.object({ |
| @@ -1444,7 +1452,7 @@ export const SingleSelectionConfigSchema = z.object({ | ||
| 1444 | 1452 | "nearest": z.boolean().optional(), |
| 1445 | 1453 | "on": z.any().optional(), |
| 1446 | 1454 | "resolve": SelectionResolutionSchema.optional(), |
| 1447 | -}); | |
| 1455 | +}).strict(); | |
| 1448 | 1456 | export type SingleSelectionConfig = z.infer<typeof SingleSelectionConfigSchema>; |
| 1449 | 1457 | |
| 1450 | 1458 | export const DataSchema = z.object({ |
| @@ -1452,7 +1460,7 @@ export const DataSchema = z.object({ | ||
| 1452 | 1460 | "url": z.string().optional(), |
| 1453 | 1461 | "values": z.union([z.array(z.union([z.boolean(), z.number(), z.record(z.string(), z.any()), z.string()])), z.record(z.string(), z.any()), z.string()]).optional(), |
| 1454 | 1462 | "name": z.string().optional(), |
| 1455 | -}); | |
| 1463 | +}).strict(); | |
| 1456 | 1464 | export type Data = z.infer<typeof DataSchema>; |
| 1457 | 1465 | |
| 1458 | 1466 | export const ScaleSchema = z.object({ |
| @@ -1471,7 +1479,7 @@ export const ScaleSchema = z.object({ | ||
| 1471 | 1479 | "scheme": z.union([SchemeParamsSchema, z.string()]).optional(), |
| 1472 | 1480 | "type": ScaleTypeSchema.optional(), |
| 1473 | 1481 | "zero": z.boolean().optional(), |
| 1474 | -}); | |
| 1482 | +}).strict(); | |
| 1475 | 1483 | export type Scale = z.infer<typeof ScaleSchema>; |
| 1476 | 1484 | |
| 1477 | 1485 | export const FacetFieldDefSchema = z.object({ |
| @@ -1482,7 +1490,7 @@ export const FacetFieldDefSchema = z.object({ | ||
| 1482 | 1490 | "sort": z.union([z.null(), SortEnumSchema]).optional(), |
| 1483 | 1491 | "timeUnit": TimeUnitSchema.optional(), |
| 1484 | 1492 | "type": TypeSchema, |
| 1485 | -}); | |
| 1493 | +}).strict(); | |
| 1486 | 1494 | export type FacetFieldDef = z.infer<typeof FacetFieldDefSchema>; |
| 1487 | 1495 | |
| 1488 | 1496 | export const DefWithConditionSchema = z.object({ |
| @@ -1493,7 +1501,7 @@ export const DefWithConditionSchema = z.object({ | ||
| 1493 | 1501 | "timeUnit": TimeUnitSchema.optional(), |
| 1494 | 1502 | "type": TypeSchema.optional(), |
| 1495 | 1503 | "value": z.union([z.boolean(), z.number(), z.string()]).optional(), |
| 1496 | -}); | |
| 1504 | +}).strict(); | |
| 1497 | 1505 | export type DefWithCondition = z.infer<typeof DefWithConditionSchema>; |
| 1498 | 1506 | |
| 1499 | 1507 | export const TextDefWithConditionSchema = z.object({ |
| @@ -1505,7 +1513,7 @@ export const TextDefWithConditionSchema = z.object({ | ||
| 1505 | 1513 | "timeUnit": TimeUnitSchema.optional(), |
| 1506 | 1514 | "type": TypeSchema.optional(), |
| 1507 | 1515 | "value": z.union([z.boolean(), z.number(), z.string()]).optional(), |
| 1508 | -}); | |
| 1516 | +}).strict(); | |
| 1509 | 1517 | export type TextDefWithCondition = z.infer<typeof TextDefWithConditionSchema>; |
| 1510 | 1518 | |
| 1511 | 1519 | export const XClassSchema = z.object({ |
| @@ -1519,34 +1527,53 @@ export const XClassSchema = z.object({ | ||
| 1519 | 1527 | "timeUnit": TimeUnitSchema.optional(), |
| 1520 | 1528 | "type": TypeSchema.optional(), |
| 1521 | 1529 | "value": z.union([z.boolean(), z.number(), z.string()]).optional(), |
| 1522 | -}); | |
| 1530 | +}).strict(); | |
| 1523 | 1531 | export type XClass = z.infer<typeof XClassSchema>; |
| 1524 | 1532 | |
| 1525 | 1533 | export const FacetMappingSchema = z.object({ |
| 1526 | 1534 | "column": FacetFieldDefSchema.optional(), |
| 1527 | 1535 | "row": FacetFieldDefSchema.optional(), |
| 1528 | -}); | |
| 1536 | +}).strict(); | |
| 1529 | 1537 | export type FacetMapping = z.infer<typeof FacetMappingSchema>; |
| 1530 | 1538 | |
| 1539 | +export const ProjectionSchema = z.object({ | |
| 1540 | + "center": z.array(z.number()).optional(), | |
| 1541 | + "clipAngle": z.number().optional(), | |
| 1542 | + "clipExtent": z.array(z.array(z.number())).optional(), | |
| 1543 | + "coefficient": z.number().optional(), | |
| 1544 | + "distance": z.number().optional(), | |
| 1545 | + "fraction": z.number().optional(), | |
| 1546 | + "lobes": z.number().optional(), | |
| 1547 | + "parallel": z.number().optional(), | |
| 1548 | + "precision": FluffyPrecisionSchema.optional(), | |
| 1549 | + "radius": z.number().optional(), | |
| 1550 | + "ratio": z.number().optional(), | |
| 1551 | + "rotate": z.array(z.number()).optional(), | |
| 1552 | + "spacing": z.number().optional(), | |
| 1553 | + "tilt": z.number().optional(), | |
| 1554 | + "type": VgProjectionTypeSchema.optional(), | |
| 1555 | +}).strict(); | |
| 1556 | +export type Projection = z.infer<typeof ProjectionSchema>; | |
| 1557 | + | |
| 1531 | 1558 | export const ResolveSchema = z.object({ |
| 1532 | 1559 | "axis": AxisResolveMapSchema.optional(), |
| 1533 | 1560 | "legend": LegendResolveMapSchema.optional(), |
| 1534 | 1561 | "scale": ScaleResolveMapSchema.optional(), |
| 1535 | -}); | |
| 1562 | +}).strict(); | |
| 1536 | 1563 | export type Resolve = z.infer<typeof ResolveSchema>; |
| 1537 | 1564 | |
| 1538 | 1565 | export const LookupDataSchema = z.object({ |
| 1539 | 1566 | "data": DataSchema, |
| 1540 | 1567 | "fields": z.array(z.string()).optional(), |
| 1541 | 1568 | "key": z.string(), |
| 1542 | -}); | |
| 1569 | +}).strict(); | |
| 1543 | 1570 | export type LookupData = z.infer<typeof LookupDataSchema>; |
| 1544 | 1571 | |
| 1545 | 1572 | export const SelectionConfigSchema = z.object({ |
| 1546 | 1573 | "interval": IntervalSelectionConfigSchema.optional(), |
| 1547 | 1574 | "multi": MultiSelectionConfigSchema.optional(), |
| 1548 | 1575 | "single": SingleSelectionConfigSchema.optional(), |
| 1549 | -}); | |
| 1576 | +}).strict(); | |
| 1550 | 1577 | export type SelectionConfig = z.infer<typeof SelectionConfigSchema>; |
| 1551 | 1578 | |
| 1552 | 1579 | export const ConditionalPredicateMarkPropFieldDefClassSchema = z.object({ |
| @@ -1561,7 +1588,7 @@ export const ConditionalPredicateMarkPropFieldDefClassSchema = z.object({ | ||
| 1561 | 1588 | "sort": z.union([z.null(), SortFieldSchema, SortEnumSchema]).optional(), |
| 1562 | 1589 | "timeUnit": TimeUnitSchema.optional(), |
| 1563 | 1590 | "type": TypeSchema.optional(), |
| 1564 | -}); | |
| 1591 | +}).strict(); | |
| 1565 | 1592 | export type ConditionalPredicateMarkPropFieldDefClass = z.infer<typeof ConditionalPredicateMarkPropFieldDefClassSchema>; |
| 1566 | 1593 | |
| 1567 | 1594 | export const TransformSchema = z.object({ |
| @@ -1576,7 +1603,7 @@ export const TransformSchema = z.object({ | ||
| 1576 | 1603 | "timeUnit": TimeUnitSchema.optional(), |
| 1577 | 1604 | "aggregate": z.array(AggregatedFieldDefSchema).optional(), |
| 1578 | 1605 | "groupby": z.array(z.string()).optional(), |
| 1579 | -}); | |
| 1606 | +}).strict(); | |
| 1580 | 1607 | export type Transform = z.infer<typeof TransformSchema>; |
| 1581 | 1608 | |
| 1582 | 1609 | export const ConfigSchema = z.object({ |
| @@ -1604,7 +1631,7 @@ export const ConfigSchema = z.object({ | ||
| 1604 | 1631 | "padding": z.union([PaddingClassSchema, z.number()]).optional(), |
| 1605 | 1632 | "point": MarkConfigSchema.optional(), |
| 1606 | 1633 | "projection": ProjectionConfigSchema.optional(), |
| 1607 | - "range": z.record(z.string(), z.union([z.array(z.union([z.number(), z.string()])), VgSchemeSchema])).optional(), | |
| 1634 | + "range": RangeConfigSchema.optional(), | |
| 1608 | 1635 | "rect": MarkConfigSchema.optional(), |
| 1609 | 1636 | "rule": MarkConfigSchema.optional(), |
| 1610 | 1637 | "scale": ScaleConfigSchema.optional(), |
| @@ -1617,7 +1644,7 @@ export const ConfigSchema = z.object({ | ||
| 1617 | 1644 | "timeFormat": z.string().optional(), |
| 1618 | 1645 | "title": VgTitleConfigSchema.optional(), |
| 1619 | 1646 | "view": ViewConfigSchema.optional(), |
| 1620 | -}); | |
| 1647 | +}).strict(); | |
| 1621 | 1648 | export type Config = z.infer<typeof ConfigSchema>; |
| 1622 | 1649 | |
| 1623 | 1650 | export const MarkPropDefWithConditionSchema = z.object({ |
| @@ -1631,7 +1658,7 @@ export const MarkPropDefWithConditionSchema = z.object({ | ||
| 1631 | 1658 | "timeUnit": TimeUnitSchema.optional(), |
| 1632 | 1659 | "type": TypeSchema.optional(), |
| 1633 | 1660 | "value": z.union([z.boolean(), z.number(), z.string()]).optional(), |
| 1634 | -}); | |
| 1661 | +}).strict(); | |
| 1635 | 1662 | export type MarkPropDefWithCondition = z.infer<typeof MarkPropDefWithConditionSchema>; |
| 1636 | 1663 | |
| 1637 | 1664 | export const EncodingSchema = z.object({ |
| @@ -1648,7 +1675,7 @@ export const EncodingSchema = z.object({ | ||
| 1648 | 1675 | "x2": X2ClassSchema.optional(), |
| 1649 | 1676 | "y": XClassSchema.optional(), |
| 1650 | 1677 | "y2": X2ClassSchema.optional(), |
| 1651 | -}); | |
| 1678 | +}).strict(); | |
| 1652 | 1679 | export type Encoding = z.infer<typeof EncodingSchema>; |
| 1653 | 1680 | |
| 1654 | 1681 | export const EncodingWithFacetSchema = z.object({ |
| @@ -1667,7 +1694,7 @@ export const EncodingWithFacetSchema = z.object({ | ||
| 1667 | 1694 | "x2": X2ClassSchema.optional(), |
| 1668 | 1695 | "y": XClassSchema.optional(), |
| 1669 | 1696 | "y2": X2ClassSchema.optional(), |
| 1670 | -}); | |
| 1697 | +}).strict(); | |
| 1671 | 1698 | export type EncodingWithFacet = z.infer<typeof EncodingWithFacetSchema>; |
| 1672 | 1699 | |
| 1673 | 1700 | export const TopLevelSchema = z.object({ |
| @@ -1694,5 +1721,5 @@ export const TopLevelSchema = z.object({ | ||
| 1694 | 1721 | "repeat": RepeatSchema.optional(), |
| 1695 | 1722 | "vconcat": z.array(SpecSchema).optional(), |
| 1696 | 1723 | "hconcat": z.array(SpecSchema).optional(), |
| 1697 | -}); | |
| 1724 | +}).strict(); | |
| 1698 | 1725 | export type TopLevel = z.infer<typeof TopLevelSchema>; |
No generated files match these filters.