@miroir-framework/jzod-ts 0.6.1 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/dist/bundle.d.ts +3 -1
- package/dist/bundle.js +3 -3
- package/package.json +10 -3
- package/babel.config.cjs +0 -13
- package/dist/out-tsc/dts/src/JzodToTs.d.ts +0 -17
- package/dist/out-tsc/dts/src/generated_jzodBootstrapElementSchema.d.ts +0 -246
- package/dist/out-tsc/dts/src/index.d.ts +0 -3
- package/dist/out-tsc/dts/src/preBuild.d.ts +0 -1
- package/dist/out-tsc/dts/src/tools.d.ts +0 -4
- package/dist/src/JzodToTs.d.ts +0 -17
- package/dist/src/generated_jzodBootstrapElementSchema.d.ts +0 -249
- package/dist/src/index.d.ts +0 -3
- package/dist/src/preBuild.d.ts +0 -1
- package/dist/src/tools.d.ts +0 -4
- package/jest.config.js +0 -63
- package/rollup.config.js +0 -36
- package/src/JzodToTs.ts +0 -118
- package/src/generated_jzodBootstrapElementSchema.ts +0 -252
- package/src/index.ts +0 -60
- package/src/preBuild.ts +0 -54
- package/src/tools.ts +0 -25
- package/tests/jzod-ts.test.ts +0 -107
- package/tests/resources/tsTypeGeneration-testJzodSchema1 - reference.ts +0 -5
- package/tests/resources/tsTypeGeneration-testJzodSchema2 - reference.ts +0 -11
- package/tests/resources/tsTypeGeneration-testJzodSchema3 - reference.ts +0 -19
- package/tests/resources/tsTypeGeneration-testJzodSchema4 - reference.ts +0 -253
- package/tsconfig.json +0 -26
package/tests/jzod-ts.test.ts
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import * as fs from "fs";
|
|
2
|
-
import * as path from "path";
|
|
3
|
-
|
|
4
|
-
import { jzodBootstrapElementSchema } from "@miroir-framework/jzod";
|
|
5
|
-
import { jzodToTsCode } from "../src/JzodToTs";
|
|
6
|
-
|
|
7
|
-
const refsPath = "./tests/resources"
|
|
8
|
-
const tmpPath = "./tests/tmp";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const testJzodToTs = (
|
|
12
|
-
// testDirectory: string,
|
|
13
|
-
referenceFileName: string,
|
|
14
|
-
testFileName: string,
|
|
15
|
-
testJzodSchema: any, //JzodElement,
|
|
16
|
-
exportPrefix: boolean,
|
|
17
|
-
typeName: string
|
|
18
|
-
) => {
|
|
19
|
-
console.log("testJzodToTs:", typeName);
|
|
20
|
-
|
|
21
|
-
const testResultSchemaFilePath = path.join(tmpPath,testFileName);
|
|
22
|
-
const expectedSchemaFilePath = path.join(refsPath,referenceFileName);
|
|
23
|
-
|
|
24
|
-
const result = jzodToTsCode(testJzodSchema,exportPrefix,typeName)
|
|
25
|
-
fs.writeFileSync(testResultSchemaFilePath,result);
|
|
26
|
-
|
|
27
|
-
const resultContents = result.replace(/(\r\n|\n|\r)/gm, "");
|
|
28
|
-
// console.log("ts Type generation resultContents", resultContents);
|
|
29
|
-
|
|
30
|
-
const expectedFileContents = fs.readFileSync(expectedSchemaFilePath).toString().replace(/(\r\n|\n|\r)/gm, "")
|
|
31
|
-
expect(resultContents).toEqual(expectedFileContents);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
describe(
|
|
36
|
-
'Jzod-Ts',
|
|
37
|
-
() => {
|
|
38
|
-
// ############################################################################################
|
|
39
|
-
it(
|
|
40
|
-
"Jzod to TS Type",
|
|
41
|
-
async() => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
// ########################################################################################
|
|
45
|
-
const testJzodSchema1: any /**JzodElement*/ = { type: "simpleType", definition: "string" };
|
|
46
|
-
|
|
47
|
-
testJzodToTs(
|
|
48
|
-
"tsTypeGeneration-testJzodSchema1 - reference.ts",
|
|
49
|
-
"tsTypeGeneration-testJzodSchema1.ts",
|
|
50
|
-
testJzodSchema1,
|
|
51
|
-
true,
|
|
52
|
-
"testJzodSchema1"
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
// ########################################################################################
|
|
56
|
-
const testJzodSchema2: any /**JzodElement*/ = {
|
|
57
|
-
type: "schemaReference",
|
|
58
|
-
context: {
|
|
59
|
-
a: { type: "simpleType", definition: "string" },
|
|
60
|
-
b: {
|
|
61
|
-
type: "object",
|
|
62
|
-
definition: {
|
|
63
|
-
test: { type: "schemaReference", definition: { relativePath: "a" } }
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
definition: { relativePath: "b" },
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
testJzodToTs(
|
|
71
|
-
"tsTypeGeneration-testJzodSchema2 - reference.ts",
|
|
72
|
-
"tsTypeGeneration-testJzodSchema2.ts",
|
|
73
|
-
testJzodSchema2,
|
|
74
|
-
true,
|
|
75
|
-
"testJzodSchema2"
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
// ########################################################################################
|
|
79
|
-
const testJzodSchema4: any /**JzodElement*/ =
|
|
80
|
-
{
|
|
81
|
-
type: "schemaReference",
|
|
82
|
-
context: {
|
|
83
|
-
...jzodBootstrapElementSchema.context,
|
|
84
|
-
a: {
|
|
85
|
-
type: "array",
|
|
86
|
-
definition: { type: "schemaReference", definition: {relativePath: "jzodArray"} }
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
definition: {
|
|
90
|
-
relativePath: "a"
|
|
91
|
-
},
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
testJzodToTs(
|
|
95
|
-
"tsTypeGeneration-testJzodSchema4 - reference.ts",
|
|
96
|
-
"tsTypeGeneration-testJzodSchema4.ts",
|
|
97
|
-
testJzodSchema4,
|
|
98
|
-
true,
|
|
99
|
-
"testJzodSchema4"
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
)
|
|
103
|
-
}
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ZodType, ZodTypeAny, z } from "zod";
|
|
2
|
-
|
|
3
|
-
export type A = string;
|
|
4
|
-
export type B = {
|
|
5
|
-
test: A;
|
|
6
|
-
};
|
|
7
|
-
export type TestJzodSchema2 = B;
|
|
8
|
-
|
|
9
|
-
export const a = z.string();
|
|
10
|
-
export const b = z.object({test:z.lazy(() =>a)}).strict();
|
|
11
|
-
export const testJzodSchema2 = z.lazy(() =>b);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ZodType, ZodTypeAny, z } from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type jzodLiteral = {
|
|
5
|
-
optional?: boolean | undefined;
|
|
6
|
-
extra?: {
|
|
7
|
-
[x: string]: any;
|
|
8
|
-
} | undefined;
|
|
9
|
-
type: "literal";
|
|
10
|
-
definition: string;
|
|
11
|
-
};
|
|
12
|
-
type jzodElement = jzodLiteral;
|
|
13
|
-
type testJzodSchema3 = {
|
|
14
|
-
b: jzodElement[];
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const jzodLiteral=z.object({optional:z.boolean().optional(),extra:z.record(z.string(),z.any()).optional(),type:z.literal("literal"),definition:z.string(),}).strict();
|
|
18
|
-
export const jzodElement=z.union([z.lazy(() =>jzodLiteral),]);
|
|
19
|
-
export const testJzodSchema3 = z.object({b:z.array(z.lazy(() =>jzodElement)),}).strict();
|
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
import { ZodType, ZodTypeAny, z } from "zod";
|
|
2
|
-
|
|
3
|
-
export type JzodBaseObject = {
|
|
4
|
-
optional?: boolean | undefined;
|
|
5
|
-
nullable?: boolean | undefined;
|
|
6
|
-
extra?: {
|
|
7
|
-
[x: string]: any;
|
|
8
|
-
} | undefined;
|
|
9
|
-
};
|
|
10
|
-
export type JzodArray = {
|
|
11
|
-
optional?: boolean | undefined;
|
|
12
|
-
nullable?: boolean | undefined;
|
|
13
|
-
extra?: {
|
|
14
|
-
[x: string]: any;
|
|
15
|
-
} | undefined;
|
|
16
|
-
type: "array";
|
|
17
|
-
definition: JzodElement;
|
|
18
|
-
};
|
|
19
|
-
export type JzodAttribute = {
|
|
20
|
-
optional?: boolean | undefined;
|
|
21
|
-
nullable?: boolean | undefined;
|
|
22
|
-
extra?: {
|
|
23
|
-
[x: string]: any;
|
|
24
|
-
} | undefined;
|
|
25
|
-
type: "simpleType";
|
|
26
|
-
coerce?: boolean | undefined;
|
|
27
|
-
definition: JzodEnumAttributeTypes;
|
|
28
|
-
};
|
|
29
|
-
export type JzodAttributeDateValidations = {
|
|
30
|
-
extra?: {
|
|
31
|
-
[x: string]: any;
|
|
32
|
-
} | undefined;
|
|
33
|
-
type: "min" | "max";
|
|
34
|
-
parameter?: any;
|
|
35
|
-
};
|
|
36
|
-
export type JzodAttributeDateWithValidations = {
|
|
37
|
-
optional?: boolean | undefined;
|
|
38
|
-
nullable?: boolean | undefined;
|
|
39
|
-
extra?: {
|
|
40
|
-
[x: string]: any;
|
|
41
|
-
} | undefined;
|
|
42
|
-
type: "simpleType";
|
|
43
|
-
definition: "date";
|
|
44
|
-
coerce?: boolean | undefined;
|
|
45
|
-
validations: JzodAttributeDateValidations[];
|
|
46
|
-
};
|
|
47
|
-
export type JzodAttributeNumberValidations = {
|
|
48
|
-
extra?: {
|
|
49
|
-
[x: string]: any;
|
|
50
|
-
} | undefined;
|
|
51
|
-
type: "gt" | "gte" | "lt" | "lte" | "int" | "positive" | "nonpositive" | "negative" | "nonnegative" | "multipleOf" | "finite" | "safe";
|
|
52
|
-
parameter?: any;
|
|
53
|
-
};
|
|
54
|
-
export type JzodAttributeNumberWithValidations = {
|
|
55
|
-
optional?: boolean | undefined;
|
|
56
|
-
nullable?: boolean | undefined;
|
|
57
|
-
extra?: {
|
|
58
|
-
[x: string]: any;
|
|
59
|
-
} | undefined;
|
|
60
|
-
type: "simpleType";
|
|
61
|
-
definition: "number";
|
|
62
|
-
coerce?: boolean | undefined;
|
|
63
|
-
validations: JzodAttributeNumberValidations[];
|
|
64
|
-
};
|
|
65
|
-
export type JzodAttributeStringValidations = {
|
|
66
|
-
extra?: {
|
|
67
|
-
[x: string]: any;
|
|
68
|
-
} | undefined;
|
|
69
|
-
type: "max" | "min" | "length" | "email" | "url" | "emoji" | "uuid" | "cuid" | "cuid2" | "ulid" | "regex" | "includes" | "startsWith" | "endsWith" | "datetime" | "ip";
|
|
70
|
-
parameter?: any;
|
|
71
|
-
};
|
|
72
|
-
export type JzodAttributeStringWithValidations = {
|
|
73
|
-
optional?: boolean | undefined;
|
|
74
|
-
nullable?: boolean | undefined;
|
|
75
|
-
extra?: {
|
|
76
|
-
[x: string]: any;
|
|
77
|
-
} | undefined;
|
|
78
|
-
type: "simpleType";
|
|
79
|
-
definition: "string";
|
|
80
|
-
coerce?: boolean | undefined;
|
|
81
|
-
validations: JzodAttributeStringValidations[];
|
|
82
|
-
};
|
|
83
|
-
export type JzodElement = JzodArray | JzodAttribute | JzodAttributeDateWithValidations | JzodAttributeNumberWithValidations | JzodAttributeStringWithValidations | JzodEnum | JzodFunction | JzodLazy | JzodLiteral | JzodIntersection | JzodMap | JzodObject | JzodPromise | JzodRecord | JzodReference | JzodSet | JzodTuple | JzodUnion;
|
|
84
|
-
export type JzodEnum = {
|
|
85
|
-
optional?: boolean | undefined;
|
|
86
|
-
nullable?: boolean | undefined;
|
|
87
|
-
extra?: {
|
|
88
|
-
[x: string]: any;
|
|
89
|
-
} | undefined;
|
|
90
|
-
type: "enum";
|
|
91
|
-
definition: string[];
|
|
92
|
-
};
|
|
93
|
-
export type JzodEnumAttributeTypes = "any" | "bigint" | "boolean" | "date" | "never" | "null" | "number" | "string" | "uuid" | "undefined" | "unknown" | "void";
|
|
94
|
-
export type JzodEnumElementTypes = "array" | "enum" | "function" | "lazy" | "literal" | "intersection" | "map" | "object" | "promise" | "record" | "schemaReference" | "set" | "simpleType" | "tuple" | "union";
|
|
95
|
-
export type JzodFunction = {
|
|
96
|
-
optional?: boolean | undefined;
|
|
97
|
-
nullable?: boolean | undefined;
|
|
98
|
-
extra?: {
|
|
99
|
-
[x: string]: any;
|
|
100
|
-
} | undefined;
|
|
101
|
-
type: "function";
|
|
102
|
-
definition: {
|
|
103
|
-
args: JzodElement[];
|
|
104
|
-
returns?: JzodElement | undefined;
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
export type JzodLazy = {
|
|
108
|
-
optional?: boolean | undefined;
|
|
109
|
-
nullable?: boolean | undefined;
|
|
110
|
-
extra?: {
|
|
111
|
-
[x: string]: any;
|
|
112
|
-
} | undefined;
|
|
113
|
-
type: "lazy";
|
|
114
|
-
definition: JzodFunction;
|
|
115
|
-
};
|
|
116
|
-
export type JzodLiteral = {
|
|
117
|
-
optional?: boolean | undefined;
|
|
118
|
-
nullable?: boolean | undefined;
|
|
119
|
-
extra?: {
|
|
120
|
-
[x: string]: any;
|
|
121
|
-
} | undefined;
|
|
122
|
-
type: "literal";
|
|
123
|
-
definition: string;
|
|
124
|
-
};
|
|
125
|
-
export type JzodIntersection = {
|
|
126
|
-
optional?: boolean | undefined;
|
|
127
|
-
nullable?: boolean | undefined;
|
|
128
|
-
extra?: {
|
|
129
|
-
[x: string]: any;
|
|
130
|
-
} | undefined;
|
|
131
|
-
type: "intersection";
|
|
132
|
-
definition: {
|
|
133
|
-
left: JzodElement;
|
|
134
|
-
right: JzodElement;
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
export type JzodMap = {
|
|
138
|
-
optional?: boolean | undefined;
|
|
139
|
-
nullable?: boolean | undefined;
|
|
140
|
-
extra?: {
|
|
141
|
-
[x: string]: any;
|
|
142
|
-
} | undefined;
|
|
143
|
-
type: "map";
|
|
144
|
-
definition: [
|
|
145
|
-
JzodElement,
|
|
146
|
-
JzodElement
|
|
147
|
-
];
|
|
148
|
-
};
|
|
149
|
-
export type JzodObject = {
|
|
150
|
-
optional?: boolean | undefined;
|
|
151
|
-
nullable?: boolean | undefined;
|
|
152
|
-
extra?: {
|
|
153
|
-
[x: string]: any;
|
|
154
|
-
} | undefined;
|
|
155
|
-
extend?: (JzodReference | JzodObject) | undefined;
|
|
156
|
-
type: "object";
|
|
157
|
-
nonStrict?: boolean | undefined;
|
|
158
|
-
definition: {
|
|
159
|
-
[x: string]: JzodElement;
|
|
160
|
-
};
|
|
161
|
-
};
|
|
162
|
-
export type JzodPromise = {
|
|
163
|
-
optional?: boolean | undefined;
|
|
164
|
-
nullable?: boolean | undefined;
|
|
165
|
-
extra?: {
|
|
166
|
-
[x: string]: any;
|
|
167
|
-
} | undefined;
|
|
168
|
-
type: "promise";
|
|
169
|
-
definition: JzodElement;
|
|
170
|
-
};
|
|
171
|
-
export type JzodRecord = {
|
|
172
|
-
optional?: boolean | undefined;
|
|
173
|
-
nullable?: boolean | undefined;
|
|
174
|
-
extra?: {
|
|
175
|
-
[x: string]: any;
|
|
176
|
-
} | undefined;
|
|
177
|
-
type: "record";
|
|
178
|
-
definition: JzodElement;
|
|
179
|
-
};
|
|
180
|
-
export type JzodReference = {
|
|
181
|
-
optional?: boolean | undefined;
|
|
182
|
-
nullable?: boolean | undefined;
|
|
183
|
-
extra?: {
|
|
184
|
-
[x: string]: any;
|
|
185
|
-
} | undefined;
|
|
186
|
-
type: "schemaReference";
|
|
187
|
-
context?: {
|
|
188
|
-
[x: string]: JzodElement;
|
|
189
|
-
} | undefined;
|
|
190
|
-
definition: {
|
|
191
|
-
eager?: boolean | undefined;
|
|
192
|
-
relativePath?: string | undefined;
|
|
193
|
-
absolutePath?: string | undefined;
|
|
194
|
-
};
|
|
195
|
-
};
|
|
196
|
-
export type JzodSet = {
|
|
197
|
-
optional?: boolean | undefined;
|
|
198
|
-
nullable?: boolean | undefined;
|
|
199
|
-
extra?: {
|
|
200
|
-
[x: string]: any;
|
|
201
|
-
} | undefined;
|
|
202
|
-
type: "set";
|
|
203
|
-
definition: JzodElement;
|
|
204
|
-
};
|
|
205
|
-
export type JzodTuple = {
|
|
206
|
-
optional?: boolean | undefined;
|
|
207
|
-
nullable?: boolean | undefined;
|
|
208
|
-
extra?: {
|
|
209
|
-
[x: string]: any;
|
|
210
|
-
} | undefined;
|
|
211
|
-
type: "tuple";
|
|
212
|
-
definition: JzodElement[];
|
|
213
|
-
};
|
|
214
|
-
export type JzodUnion = {
|
|
215
|
-
optional?: boolean | undefined;
|
|
216
|
-
nullable?: boolean | undefined;
|
|
217
|
-
extra?: {
|
|
218
|
-
[x: string]: any;
|
|
219
|
-
} | undefined;
|
|
220
|
-
type: "union";
|
|
221
|
-
discriminator?: string | undefined;
|
|
222
|
-
definition: JzodElement[];
|
|
223
|
-
};
|
|
224
|
-
export type A = JzodArray[];
|
|
225
|
-
export type TestJzodSchema4 = A;
|
|
226
|
-
|
|
227
|
-
export const jzodBaseObject = z.object({optional:z.boolean().optional(), nullable:z.boolean().optional(), extra:z.record(z.string(),z.any()).optional()}).strict();
|
|
228
|
-
export const jzodArray = z.object({optional:z.boolean().optional(), nullable:z.boolean().optional(), extra:z.record(z.string(),z.any()).optional()}).strict().extend({type:z.literal("array"), definition:z.lazy(() =>jzodElement)}).strict();
|
|
229
|
-
export const jzodAttribute = z.object({optional:z.boolean().optional(), nullable:z.boolean().optional(), extra:z.record(z.string(),z.any()).optional()}).strict().extend({type:z.literal("simpleType"), coerce:z.boolean().optional(), definition:z.lazy(() =>jzodEnumAttributeTypes)}).strict();
|
|
230
|
-
export const jzodAttributeDateValidations = z.object({extra:z.record(z.string(),z.any()).optional(), type:z.enum(["min","max"]), parameter:z.any()}).strict();
|
|
231
|
-
export const jzodAttributeDateWithValidations = z.object({optional:z.boolean().optional(), nullable:z.boolean().optional(), extra:z.record(z.string(),z.any()).optional()}).strict().extend({type:z.literal("simpleType"), definition:z.literal("date"), coerce:z.boolean().optional(), validations:z.array(z.lazy(() =>jzodAttributeDateValidations))}).strict();
|
|
232
|
-
export const jzodAttributeNumberValidations = z.object({extra:z.record(z.string(),z.any()).optional(), type:z.enum(["gt","gte","lt","lte","int","positive","nonpositive","negative","nonnegative","multipleOf","finite","safe"]), parameter:z.any()}).strict();
|
|
233
|
-
export const jzodAttributeNumberWithValidations = z.object({optional:z.boolean().optional(), nullable:z.boolean().optional(), extra:z.record(z.string(),z.any()).optional()}).strict().extend({type:z.literal("simpleType"), definition:z.literal("number"), coerce:z.boolean().optional(), validations:z.array(z.lazy(() =>jzodAttributeNumberValidations))}).strict();
|
|
234
|
-
export const jzodAttributeStringValidations = z.object({extra:z.record(z.string(),z.any()).optional(), type:z.enum(["max","min","length","email","url","emoji","uuid","cuid","cuid2","ulid","regex","includes","startsWith","endsWith","datetime","ip"]), parameter:z.any()}).strict();
|
|
235
|
-
export const jzodAttributeStringWithValidations = z.object({optional:z.boolean().optional(), nullable:z.boolean().optional(), extra:z.record(z.string(),z.any()).optional()}).strict().extend({type:z.literal("simpleType"), definition:z.literal("string"), coerce:z.boolean().optional(), validations:z.array(z.lazy(() =>jzodAttributeStringValidations))}).strict();
|
|
236
|
-
export const jzodElement = z.union([z.lazy(() =>jzodArray), z.lazy(() =>jzodAttribute), z.lazy(() =>jzodAttributeDateWithValidations), z.lazy(() =>jzodAttributeNumberWithValidations), z.lazy(() =>jzodAttributeStringWithValidations), z.lazy(() =>jzodEnum), z.lazy(() =>jzodFunction), z.lazy(() =>jzodLazy), z.lazy(() =>jzodLiteral), z.lazy(() =>jzodIntersection), z.lazy(() =>jzodMap), z.lazy(() =>jzodObject), z.lazy(() =>jzodPromise), z.lazy(() =>jzodRecord), z.lazy(() =>jzodReference), z.lazy(() =>jzodSet), z.lazy(() =>jzodTuple), z.lazy(() =>jzodUnion)]);
|
|
237
|
-
export const jzodEnum = z.object({optional:z.boolean().optional(), nullable:z.boolean().optional(), extra:z.record(z.string(),z.any()).optional()}).strict().extend({type:z.literal("enum"), definition:z.array(z.string())}).strict();
|
|
238
|
-
export const jzodEnumAttributeTypes = z.enum(["any","bigint","boolean","date","never","null","number","string","uuid","undefined","unknown","void"]);
|
|
239
|
-
export const jzodEnumElementTypes = z.enum(["array","enum","function","lazy","literal","intersection","map","object","promise","record","schemaReference","set","simpleType","tuple","union"]);
|
|
240
|
-
export const jzodFunction = z.object({optional:z.boolean().optional(), nullable:z.boolean().optional(), extra:z.record(z.string(),z.any()).optional()}).strict().extend({type:z.literal("function"), definition:z.object({args:z.array(z.lazy(() =>jzodElement)), returns:z.lazy(() =>jzodElement).optional()}).strict()}).strict();
|
|
241
|
-
export const jzodLazy = z.object({optional:z.boolean().optional(), nullable:z.boolean().optional(), extra:z.record(z.string(),z.any()).optional()}).strict().extend({type:z.literal("lazy"), definition:z.lazy(() =>jzodFunction)}).strict();
|
|
242
|
-
export const jzodLiteral = z.object({optional:z.boolean().optional(), nullable:z.boolean().optional(), extra:z.record(z.string(),z.any()).optional()}).strict().extend({type:z.literal("literal"), definition:z.string()}).strict();
|
|
243
|
-
export const jzodIntersection = z.object({optional:z.boolean().optional(), nullable:z.boolean().optional(), extra:z.record(z.string(),z.any()).optional()}).strict().extend({type:z.literal("intersection"), definition:z.object({left:z.lazy(() =>jzodElement), right:z.lazy(() =>jzodElement)}).strict()}).strict();
|
|
244
|
-
export const jzodMap = z.object({optional:z.boolean().optional(), nullable:z.boolean().optional(), extra:z.record(z.string(),z.any()).optional()}).strict().extend({type:z.literal("map"), definition:z.tuple([z.lazy(() =>jzodElement), z.lazy(() =>jzodElement)])}).strict();
|
|
245
|
-
export const jzodObject = z.object({optional:z.boolean().optional(), nullable:z.boolean().optional(), extra:z.record(z.string(),z.any()).optional()}).strict().extend({extend:z.union([z.lazy(() =>jzodReference), z.lazy(() =>jzodObject)]).optional(), type:z.literal("object"), nonStrict:z.boolean().optional(), definition:z.record(z.string(),z.lazy(() =>jzodElement))}).strict();
|
|
246
|
-
export const jzodPromise = z.object({optional:z.boolean().optional(), nullable:z.boolean().optional(), extra:z.record(z.string(),z.any()).optional()}).strict().extend({type:z.literal("promise"), definition:z.lazy(() =>jzodElement)}).strict();
|
|
247
|
-
export const jzodRecord = z.object({optional:z.boolean().optional(), nullable:z.boolean().optional(), extra:z.record(z.string(),z.any()).optional()}).strict().extend({type:z.literal("record"), definition:z.lazy(() =>jzodElement)}).strict();
|
|
248
|
-
export const jzodReference = z.object({optional:z.boolean().optional(), nullable:z.boolean().optional(), extra:z.record(z.string(),z.any()).optional()}).strict().extend({type:z.literal("schemaReference"), context:z.record(z.string(),z.lazy(() =>jzodElement)).optional(), definition:z.object({eager:z.boolean().optional(), relativePath:z.string().optional(), absolutePath:z.string().optional()}).strict()}).strict();
|
|
249
|
-
export const jzodSet = z.object({optional:z.boolean().optional(), nullable:z.boolean().optional(), extra:z.record(z.string(),z.any()).optional()}).strict().extend({type:z.literal("set"), definition:z.lazy(() =>jzodElement)}).strict();
|
|
250
|
-
export const jzodTuple = z.object({optional:z.boolean().optional(), nullable:z.boolean().optional(), extra:z.record(z.string(),z.any()).optional()}).strict().extend({type:z.literal("tuple"), definition:z.array(z.lazy(() =>jzodElement))}).strict();
|
|
251
|
-
export const jzodUnion = z.object({optional:z.boolean().optional(), nullable:z.boolean().optional(), extra:z.record(z.string(),z.any()).optional()}).strict().extend({type:z.literal("union"), discriminator:z.string().optional(), definition:z.array(z.lazy(() =>jzodElement))}).strict();
|
|
252
|
-
export const a = z.array(z.lazy(() =>jzodArray));
|
|
253
|
-
export const testJzodSchema4 = z.lazy(() =>a);
|
package/tsconfig.json
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"outDir": "dist/out-tsc",
|
|
4
|
-
"declaration": true,
|
|
5
|
-
"declarationDir": "dist/out-tsc/dts",
|
|
6
|
-
"rootDir": "./",
|
|
7
|
-
"baseUrl": "./",
|
|
8
|
-
"types": ["node", "jest"],
|
|
9
|
-
"removeComments": true,
|
|
10
|
-
"module": "ESNext",
|
|
11
|
-
"target": "ES2017",
|
|
12
|
-
"jsx": "react-jsx",
|
|
13
|
-
"moduleResolution": "Node",
|
|
14
|
-
"esModuleInterop": true,
|
|
15
|
-
"allowSyntheticDefaultImports":true,
|
|
16
|
-
"resolveJsonModule": true,
|
|
17
|
-
"lib": ["es6", "dom"],
|
|
18
|
-
"noImplicitAny": true,
|
|
19
|
-
"noImplicitThis": true,
|
|
20
|
-
"strictNullChecks": true,
|
|
21
|
-
"plugins": [
|
|
22
|
-
],
|
|
23
|
-
},
|
|
24
|
-
"exclude": ["./node_modules/**","./src/**/*.spec.js", "./src/**/*.spec.jsx", "./src/**/*.spec.ts", "./src/**/*.spec.tsx"],
|
|
25
|
-
"include": ["./src/**/*.json", "./src/**/*.js", "./src/**/*.jsx", "./src/**/*.ts", "./src/**/*.tsx", "src/preBuild.ts"]
|
|
26
|
-
}
|