@tktb-tess/my-zod-schema 0.1.5 → 0.2.0
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/dist/bundle.js +256 -178
- package/dist/comma-data.d.ts +49 -0
- package/dist/cotec-json.d.ts +102 -0
- package/dist/main.d.ts +2 -1
- package/dist/util.d.ts +1 -20
- package/package.json +11 -8
package/dist/bundle.js
CHANGED
|
@@ -1,189 +1,267 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
text: e.string()
|
|
34
|
-
}), g = e.object({
|
|
35
|
-
title: e.string(),
|
|
36
|
-
form: e.string()
|
|
37
|
-
}), b = e.object({
|
|
38
|
-
title: e.string(),
|
|
39
|
-
entry: a
|
|
40
|
-
}), d = {
|
|
41
|
-
entry: a,
|
|
42
|
-
translations: m.array(),
|
|
43
|
-
tags: e.string().array(),
|
|
44
|
-
contents: l.array(),
|
|
45
|
-
variations: g.array(),
|
|
46
|
-
relations: b.array()
|
|
47
|
-
}, p = e.object(d), S = e.looseObject(d), h = e.object({
|
|
48
|
-
id: e.int().nonnegative(),
|
|
49
|
-
sentence: e.string(),
|
|
50
|
-
translation: e.string(),
|
|
51
|
-
supplement: e.string().optional(),
|
|
52
|
-
tags: e.string().array(),
|
|
53
|
-
words: e.object({
|
|
54
|
-
id: e.int().nonnegative()
|
|
1
|
+
import t from "zod";
|
|
2
|
+
const e = t.object({
|
|
3
|
+
id: t.int().nonnegative(),
|
|
4
|
+
form: t.string()
|
|
5
|
+
}).brand(), i = t.object({
|
|
6
|
+
title: t.string(),
|
|
7
|
+
forms: t.string().array(),
|
|
8
|
+
rawForms: t.string().optional()
|
|
9
|
+
}), s = t.object({
|
|
10
|
+
title: t.string(),
|
|
11
|
+
text: t.string()
|
|
12
|
+
}), c = t.object({
|
|
13
|
+
title: t.string(),
|
|
14
|
+
form: t.string()
|
|
15
|
+
}), l = t.object({
|
|
16
|
+
title: t.string(),
|
|
17
|
+
entry: e
|
|
18
|
+
}), m = {
|
|
19
|
+
entry: e,
|
|
20
|
+
translations: i.array(),
|
|
21
|
+
tags: t.string().array(),
|
|
22
|
+
contents: s.array(),
|
|
23
|
+
variations: c.array(),
|
|
24
|
+
relations: l.array()
|
|
25
|
+
}, g = t.object(m), p = t.looseObject(m), d = t.object({
|
|
26
|
+
id: t.int().nonnegative(),
|
|
27
|
+
sentence: t.string(),
|
|
28
|
+
translation: t.string(),
|
|
29
|
+
supplement: t.string().optional(),
|
|
30
|
+
tags: t.string().array(),
|
|
31
|
+
words: t.object({
|
|
32
|
+
id: t.int().nonnegative()
|
|
55
33
|
}).array(),
|
|
56
|
-
offer:
|
|
57
|
-
catalog:
|
|
58
|
-
number:
|
|
34
|
+
offer: t.object({
|
|
35
|
+
catalog: t.string(),
|
|
36
|
+
number: t.int().nonnegative()
|
|
59
37
|
}).optional()
|
|
60
|
-
}),
|
|
61
|
-
explanation:
|
|
62
|
-
punctuations:
|
|
63
|
-
ignoredPattern:
|
|
64
|
-
pronunciationTitle:
|
|
65
|
-
enableMarkdown:
|
|
66
|
-
}),
|
|
67
|
-
version:
|
|
38
|
+
}), b = t.object({
|
|
39
|
+
explanation: t.string().optional(),
|
|
40
|
+
punctuations: t.string().array(),
|
|
41
|
+
ignoredPattern: t.string().optional(),
|
|
42
|
+
pronunciationTitle: t.string(),
|
|
43
|
+
enableMarkdown: t.boolean()
|
|
44
|
+
}), y = t.object({
|
|
45
|
+
version: t.literal(1).optional(),
|
|
46
|
+
words: g.array()
|
|
47
|
+
}).brand(), n = t.looseObject({
|
|
48
|
+
version: t.literal(2),
|
|
68
49
|
words: p.array()
|
|
69
|
-
}).brand(),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
snoj: e.string().optional(),
|
|
79
|
-
zatlin: e.string().optional()
|
|
80
|
-
}), A = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
50
|
+
}).brand(), x = t.discriminatedUnion("version", [
|
|
51
|
+
y,
|
|
52
|
+
n
|
|
53
|
+
]), O = n.extend({
|
|
54
|
+
examples: d.array(),
|
|
55
|
+
zpdicOnline: b,
|
|
56
|
+
snoj: t.string().optional(),
|
|
57
|
+
zatlin: t.string().optional()
|
|
58
|
+
}), F = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
81
59
|
__proto__: null,
|
|
82
|
-
contentSchema:
|
|
83
|
-
entrySchema:
|
|
84
|
-
otmjsonSchema:
|
|
85
|
-
relationSchema:
|
|
86
|
-
translationSchema:
|
|
87
|
-
v1Schema:
|
|
88
|
-
v2Schema:
|
|
89
|
-
variationSchema:
|
|
90
|
-
wordv1Schema:
|
|
91
|
-
wordv2Schema:
|
|
92
|
-
zpdicConfigSchema:
|
|
93
|
-
zpdicExampleSchema:
|
|
94
|
-
zpdicOtmSchema:
|
|
95
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
96
|
-
titles:
|
|
97
|
-
names:
|
|
98
|
-
nameString:
|
|
99
|
-
ignoredPattern:
|
|
100
|
-
hidden:
|
|
101
|
-
}),
|
|
102
|
-
title:
|
|
103
|
-
text:
|
|
104
|
-
hidden:
|
|
105
|
-
}),
|
|
106
|
-
titles:
|
|
107
|
-
form:
|
|
108
|
-
terms:
|
|
109
|
-
termString:
|
|
110
|
-
ignoredPattern:
|
|
111
|
-
}),
|
|
112
|
-
title:
|
|
113
|
-
name:
|
|
114
|
-
pronunciation:
|
|
115
|
-
}), T =
|
|
116
|
-
titles:
|
|
117
|
-
number:
|
|
118
|
-
name:
|
|
119
|
-
}),
|
|
120
|
-
sentence:
|
|
121
|
-
supplement:
|
|
122
|
-
translation:
|
|
123
|
-
tags:
|
|
124
|
-
words:
|
|
125
|
-
number:
|
|
60
|
+
contentSchema: s,
|
|
61
|
+
entrySchema: e,
|
|
62
|
+
otmjsonSchema: x,
|
|
63
|
+
relationSchema: l,
|
|
64
|
+
translationSchema: i,
|
|
65
|
+
v1Schema: y,
|
|
66
|
+
v2Schema: n,
|
|
67
|
+
variationSchema: c,
|
|
68
|
+
wordv1Schema: g,
|
|
69
|
+
wordv2Schema: p,
|
|
70
|
+
zpdicConfigSchema: b,
|
|
71
|
+
zpdicExampleSchema: d,
|
|
72
|
+
zpdicOtmSchema: O
|
|
73
|
+
}, Symbol.toStringTag, { value: "Module" })), w = t.object({
|
|
74
|
+
titles: t.string().array(),
|
|
75
|
+
names: t.string().array(),
|
|
76
|
+
nameString: t.string(),
|
|
77
|
+
ignoredPattern: t.string(),
|
|
78
|
+
hidden: t.boolean()
|
|
79
|
+
}), a = t.string().brand(), z = t.object({
|
|
80
|
+
title: t.string(),
|
|
81
|
+
text: t.string(),
|
|
82
|
+
hidden: t.boolean()
|
|
83
|
+
}), _ = t.object({
|
|
84
|
+
titles: t.string().array(),
|
|
85
|
+
form: t.string(),
|
|
86
|
+
terms: t.string().array(),
|
|
87
|
+
termString: t.string(),
|
|
88
|
+
ignoredPattern: t.string()
|
|
89
|
+
}), P = t.object({
|
|
90
|
+
title: t.string(),
|
|
91
|
+
name: t.string(),
|
|
92
|
+
pronunciation: t.string()
|
|
93
|
+
}), T = t.object({
|
|
94
|
+
titles: t.string().array(),
|
|
95
|
+
number: t.int().nonnegative(),
|
|
96
|
+
name: t.string()
|
|
97
|
+
}), S = t.string(), j = t.object({
|
|
98
|
+
sentence: t.string(),
|
|
99
|
+
supplement: t.string(),
|
|
100
|
+
translation: t.string(),
|
|
101
|
+
tags: t.string().array(),
|
|
102
|
+
words: t.object({
|
|
103
|
+
number: t.number()
|
|
126
104
|
}).array(),
|
|
127
|
-
offer:
|
|
128
|
-
catalog:
|
|
129
|
-
number:
|
|
105
|
+
offer: t.object({
|
|
106
|
+
catalog: S,
|
|
107
|
+
number: t.number()
|
|
130
108
|
}).nullable()
|
|
131
|
-
}),
|
|
132
|
-
id:
|
|
133
|
-
number:
|
|
134
|
-
}),
|
|
135
|
-
name:
|
|
136
|
-
pronunciation:
|
|
137
|
-
equivalents:
|
|
138
|
-
tags:
|
|
139
|
-
phrases:
|
|
140
|
-
informations:
|
|
141
|
-
variations:
|
|
109
|
+
}), r = j.extend({
|
|
110
|
+
id: a,
|
|
111
|
+
number: t.int().nonnegative()
|
|
112
|
+
}), h = t.object({
|
|
113
|
+
name: t.string(),
|
|
114
|
+
pronunciation: t.string(),
|
|
115
|
+
equivalents: w.array(),
|
|
116
|
+
tags: t.string().array(),
|
|
117
|
+
phrases: _.array(),
|
|
118
|
+
informations: z.array(),
|
|
119
|
+
variations: P.array(),
|
|
142
120
|
relations: T.array()
|
|
143
|
-
}),
|
|
144
|
-
id:
|
|
145
|
-
number:
|
|
146
|
-
}),
|
|
147
|
-
examples:
|
|
148
|
-
}),
|
|
149
|
-
word:
|
|
150
|
-
}),
|
|
151
|
-
word:
|
|
152
|
-
}),
|
|
153
|
-
words:
|
|
154
|
-
total:
|
|
155
|
-
}),
|
|
156
|
-
example:
|
|
157
|
-
}),
|
|
158
|
-
examples:
|
|
159
|
-
total:
|
|
160
|
-
}),
|
|
161
|
-
id:
|
|
162
|
-
catalog:
|
|
163
|
-
number:
|
|
164
|
-
translation:
|
|
165
|
-
supplement:
|
|
166
|
-
author:
|
|
167
|
-
}),
|
|
168
|
-
exampleOffer:
|
|
169
|
-
}),
|
|
170
|
-
exampleOffers:
|
|
171
|
-
total:
|
|
172
|
-
}),
|
|
121
|
+
}), u = h.extend({
|
|
122
|
+
id: a,
|
|
123
|
+
number: t.int().nonnegative()
|
|
124
|
+
}), v = u.extend({
|
|
125
|
+
examples: r.array()
|
|
126
|
+
}), E = t.object({
|
|
127
|
+
word: u
|
|
128
|
+
}), R = t.object({
|
|
129
|
+
word: v
|
|
130
|
+
}), I = t.object({
|
|
131
|
+
words: v.array(),
|
|
132
|
+
total: t.int().nonnegative()
|
|
133
|
+
}), N = t.object({
|
|
134
|
+
example: r
|
|
135
|
+
}), $ = t.object({
|
|
136
|
+
examples: r.array(),
|
|
137
|
+
total: t.int().nonnegative()
|
|
138
|
+
}), f = t.object({
|
|
139
|
+
id: a,
|
|
140
|
+
catalog: S,
|
|
141
|
+
number: t.int().nonnegative(),
|
|
142
|
+
translation: t.string(),
|
|
143
|
+
supplement: t.string(),
|
|
144
|
+
author: t.string()
|
|
145
|
+
}), A = t.object({
|
|
146
|
+
exampleOffer: f
|
|
147
|
+
}), C = t.object({
|
|
148
|
+
exampleOffers: f.array(),
|
|
149
|
+
total: t.int().nonnegative()
|
|
150
|
+
}), G = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
151
|
+
__proto__: null,
|
|
152
|
+
editableExampleSchema: j,
|
|
153
|
+
editableWordSchema: h,
|
|
154
|
+
exOfferResponseSchema: A,
|
|
155
|
+
exResponseSchema: N,
|
|
156
|
+
mExOfferResponseSchema: C,
|
|
157
|
+
mExResponseSchema: $,
|
|
158
|
+
mwweResponseSchema: I,
|
|
159
|
+
wordResponseSchema: E,
|
|
160
|
+
wweResponseSchema: R
|
|
161
|
+
}, Symbol.toStringTag, { value: "Module" })), M = t.object({
|
|
162
|
+
lastUpdate: t.iso.datetime(),
|
|
163
|
+
numberOf: t.int().nonnegative()
|
|
164
|
+
}), D = t.tuple([t.int().nonnegative(), t.int()]).readonly().array(), o = t.object({
|
|
165
|
+
id: t.string(),
|
|
166
|
+
name: t.string().array(),
|
|
167
|
+
colorName: t.tuple([t.string(), t.string()]),
|
|
168
|
+
namedBy: t.string().optional()
|
|
169
|
+
}), U = t.discriminatedUnion("commaType", [
|
|
170
|
+
o.extend({
|
|
171
|
+
commaType: t.literal("rational"),
|
|
172
|
+
monzo: D
|
|
173
|
+
}),
|
|
174
|
+
o.extend({
|
|
175
|
+
commaType: t.literal("irrational"),
|
|
176
|
+
ratio: t.string(),
|
|
177
|
+
cents: t.number().nonnegative()
|
|
178
|
+
})
|
|
179
|
+
]), L = t.object({
|
|
180
|
+
metadata: M,
|
|
181
|
+
commas: U.array()
|
|
182
|
+
}), H = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
183
|
+
__proto__: null,
|
|
184
|
+
commaDataSchema: L
|
|
185
|
+
}, Symbol.toStringTag, { value: "Module" })), J = t.union([
|
|
186
|
+
t.literal("INT"),
|
|
187
|
+
t.literal("ART"),
|
|
188
|
+
t.literal("EXP"),
|
|
189
|
+
t.literal("PHI"),
|
|
190
|
+
t.literal("HYP"),
|
|
191
|
+
t.literal("NAT"),
|
|
192
|
+
t.literal("REA"),
|
|
193
|
+
t.literal("IMG"),
|
|
194
|
+
t.literal("CIN"),
|
|
195
|
+
t.literal("CDE"),
|
|
196
|
+
t.literal("GEN"),
|
|
197
|
+
t.literal("SPE"),
|
|
198
|
+
t.literal("SON"),
|
|
199
|
+
t.literal("LIT"),
|
|
200
|
+
t.literal("KIN"),
|
|
201
|
+
t.literal("SER"),
|
|
202
|
+
t.literal("JOK"),
|
|
203
|
+
t.literal("PAV"),
|
|
204
|
+
t.literal("AAV"),
|
|
205
|
+
t.literal("PWL"),
|
|
206
|
+
t.literal("AWL"),
|
|
207
|
+
t.literal("TOL"),
|
|
208
|
+
t.literal("PRI"),
|
|
209
|
+
t.literal("PUB"),
|
|
210
|
+
t.literal("FIX")
|
|
211
|
+
]), W = t.object({
|
|
212
|
+
datasize: t.tuple([t.int().nonnegative(), t.int().nonnegative()]),
|
|
213
|
+
title: t.string(),
|
|
214
|
+
author: t.string().array(),
|
|
215
|
+
createdDate: t.iso.datetime(),
|
|
216
|
+
lastUpdate: t.iso.datetime(),
|
|
217
|
+
jsonLastUpdate: t.iso.datetime(),
|
|
218
|
+
license: t.object({
|
|
219
|
+
name: t.string(),
|
|
220
|
+
content: t.string()
|
|
221
|
+
}),
|
|
222
|
+
advanced: t.int().nonnegative(),
|
|
223
|
+
label: t.string().array(),
|
|
224
|
+
type: t.string().array()
|
|
225
|
+
}), k = t.object({
|
|
226
|
+
id: t.string(),
|
|
227
|
+
messier: t.unknown().optional(),
|
|
228
|
+
name: t.string().array(),
|
|
229
|
+
kanji: t.string().array(),
|
|
230
|
+
desc: t.string().array(),
|
|
231
|
+
creator: t.string().array(),
|
|
232
|
+
period: t.string().optional(),
|
|
233
|
+
site: t.object({
|
|
234
|
+
name: t.string().optional(),
|
|
235
|
+
url: t.url()
|
|
236
|
+
}).array().optional(),
|
|
237
|
+
twitter: t.string().array().optional(),
|
|
238
|
+
dict: t.string().array().optional(),
|
|
239
|
+
grammar: t.string().array().optional(),
|
|
240
|
+
world: t.string().array().optional(),
|
|
241
|
+
category: t.object({
|
|
242
|
+
name: t.string(),
|
|
243
|
+
content: t.string().optional()
|
|
244
|
+
}).array().optional(),
|
|
245
|
+
moyune: J.array().optional(),
|
|
246
|
+
clav3: t.object({
|
|
247
|
+
dialect: t.string().regex(/^(?:[a-z]{2}|~)$/),
|
|
248
|
+
language: t.string().regex(/^[a-z]{2}$/),
|
|
249
|
+
family: t.string().regex(/^(?:[a-z]{3}|~)$/),
|
|
250
|
+
creator: t.string().regex(/^[a-z]{3}$/)
|
|
251
|
+
}).optional(),
|
|
252
|
+
part: t.string().optional(),
|
|
253
|
+
example: t.string().array().optional(),
|
|
254
|
+
script: t.string().array().optional()
|
|
255
|
+
}), B = t.object({
|
|
256
|
+
metadata: W,
|
|
257
|
+
contents: k.array()
|
|
258
|
+
}).brand(), K = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
173
259
|
__proto__: null,
|
|
174
|
-
|
|
175
|
-
editableWordSchema: v,
|
|
176
|
-
exOfferResponseSchema: N,
|
|
177
|
-
exResponseSchema: I,
|
|
178
|
-
mExOfferResponseSchema: U,
|
|
179
|
-
mExResponseSchema: J,
|
|
180
|
-
mwweResponseSchema: D,
|
|
181
|
-
wordResponseSchema: q,
|
|
182
|
-
wweResponseSchema: C
|
|
260
|
+
schema: B
|
|
183
261
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
184
262
|
export {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
F as
|
|
188
|
-
|
|
263
|
+
H as Comma,
|
|
264
|
+
K as CotecJSON,
|
|
265
|
+
F as OTMJSON,
|
|
266
|
+
G as ZpDIC
|
|
189
267
|
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { default as z } from 'zod';
|
|
2
|
+
declare const metadataSchema: z.ZodObject<{
|
|
3
|
+
lastUpdate: z.ZodISODateTime;
|
|
4
|
+
numberOf: z.ZodInt;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export type Metadata = z.infer<typeof metadataSchema>;
|
|
7
|
+
declare const monzoSchema: z.ZodArray<z.ZodReadonly<z.ZodTuple<[z.ZodInt, z.ZodInt], null>>>;
|
|
8
|
+
export type Monzo = z.infer<typeof monzoSchema>;
|
|
9
|
+
declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
name: z.ZodArray<z.ZodString>;
|
|
12
|
+
colorName: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
13
|
+
namedBy: z.ZodOptional<z.ZodString>;
|
|
14
|
+
commaType: z.ZodLiteral<"rational">;
|
|
15
|
+
monzo: z.ZodArray<z.ZodReadonly<z.ZodTuple<[z.ZodInt, z.ZodInt], null>>>;
|
|
16
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
17
|
+
id: z.ZodString;
|
|
18
|
+
name: z.ZodArray<z.ZodString>;
|
|
19
|
+
colorName: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
20
|
+
namedBy: z.ZodOptional<z.ZodString>;
|
|
21
|
+
commaType: z.ZodLiteral<"irrational">;
|
|
22
|
+
ratio: z.ZodString;
|
|
23
|
+
cents: z.ZodNumber;
|
|
24
|
+
}, z.core.$strip>], "commaType">;
|
|
25
|
+
export type Content = z.infer<typeof contentSchema>;
|
|
26
|
+
export declare const commaDataSchema: z.ZodObject<{
|
|
27
|
+
metadata: z.ZodObject<{
|
|
28
|
+
lastUpdate: z.ZodISODateTime;
|
|
29
|
+
numberOf: z.ZodInt;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
commas: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
32
|
+
id: z.ZodString;
|
|
33
|
+
name: z.ZodArray<z.ZodString>;
|
|
34
|
+
colorName: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
35
|
+
namedBy: z.ZodOptional<z.ZodString>;
|
|
36
|
+
commaType: z.ZodLiteral<"rational">;
|
|
37
|
+
monzo: z.ZodArray<z.ZodReadonly<z.ZodTuple<[z.ZodInt, z.ZodInt], null>>>;
|
|
38
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
name: z.ZodArray<z.ZodString>;
|
|
41
|
+
colorName: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
42
|
+
namedBy: z.ZodOptional<z.ZodString>;
|
|
43
|
+
commaType: z.ZodLiteral<"irrational">;
|
|
44
|
+
ratio: z.ZodString;
|
|
45
|
+
cents: z.ZodNumber;
|
|
46
|
+
}, z.core.$strip>], "commaType">>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
export type CommaData = z.infer<typeof commaDataSchema>;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { default as z } from 'zod';
|
|
2
|
+
declare const moyuneClassSchema: z.ZodUnion<readonly [z.ZodLiteral<"INT">, z.ZodLiteral<"ART">, z.ZodLiteral<"EXP">, z.ZodLiteral<"PHI">, z.ZodLiteral<"HYP">, z.ZodLiteral<"NAT">, z.ZodLiteral<"REA">, z.ZodLiteral<"IMG">, z.ZodLiteral<"CIN">, z.ZodLiteral<"CDE">, z.ZodLiteral<"GEN">, z.ZodLiteral<"SPE">, z.ZodLiteral<"SON">, z.ZodLiteral<"LIT">, z.ZodLiteral<"KIN">, z.ZodLiteral<"SER">, z.ZodLiteral<"JOK">, z.ZodLiteral<"PAV">, z.ZodLiteral<"AAV">, z.ZodLiteral<"PWL">, z.ZodLiteral<"AWL">, z.ZodLiteral<"TOL">, z.ZodLiteral<"PRI">, z.ZodLiteral<"PUB">, z.ZodLiteral<"FIX">]>;
|
|
3
|
+
export type MoyuneClass = z.infer<typeof moyuneClassSchema>;
|
|
4
|
+
declare const metadataSchema: z.ZodObject<{
|
|
5
|
+
datasize: z.ZodTuple<[z.ZodInt, z.ZodInt], null>;
|
|
6
|
+
title: z.ZodString;
|
|
7
|
+
author: z.ZodArray<z.ZodString>;
|
|
8
|
+
createdDate: z.ZodISODateTime;
|
|
9
|
+
lastUpdate: z.ZodISODateTime;
|
|
10
|
+
jsonLastUpdate: z.ZodISODateTime;
|
|
11
|
+
license: z.ZodObject<{
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
content: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
advanced: z.ZodInt;
|
|
16
|
+
label: z.ZodArray<z.ZodString>;
|
|
17
|
+
type: z.ZodArray<z.ZodString>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export type Metadata = z.infer<typeof metadataSchema>;
|
|
20
|
+
declare const contentSchema: z.ZodObject<{
|
|
21
|
+
id: z.ZodString;
|
|
22
|
+
messier: z.ZodOptional<z.ZodUnknown>;
|
|
23
|
+
name: z.ZodArray<z.ZodString>;
|
|
24
|
+
kanji: z.ZodArray<z.ZodString>;
|
|
25
|
+
desc: z.ZodArray<z.ZodString>;
|
|
26
|
+
creator: z.ZodArray<z.ZodString>;
|
|
27
|
+
period: z.ZodOptional<z.ZodString>;
|
|
28
|
+
site: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
29
|
+
name: z.ZodOptional<z.ZodString>;
|
|
30
|
+
url: z.ZodURL;
|
|
31
|
+
}, z.core.$strip>>>;
|
|
32
|
+
twitter: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
33
|
+
dict: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
34
|
+
grammar: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
35
|
+
world: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
36
|
+
category: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
content: z.ZodOptional<z.ZodString>;
|
|
39
|
+
}, z.core.$strip>>>;
|
|
40
|
+
moyune: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"INT">, z.ZodLiteral<"ART">, z.ZodLiteral<"EXP">, z.ZodLiteral<"PHI">, z.ZodLiteral<"HYP">, z.ZodLiteral<"NAT">, z.ZodLiteral<"REA">, z.ZodLiteral<"IMG">, z.ZodLiteral<"CIN">, z.ZodLiteral<"CDE">, z.ZodLiteral<"GEN">, z.ZodLiteral<"SPE">, z.ZodLiteral<"SON">, z.ZodLiteral<"LIT">, z.ZodLiteral<"KIN">, z.ZodLiteral<"SER">, z.ZodLiteral<"JOK">, z.ZodLiteral<"PAV">, z.ZodLiteral<"AAV">, z.ZodLiteral<"PWL">, z.ZodLiteral<"AWL">, z.ZodLiteral<"TOL">, z.ZodLiteral<"PRI">, z.ZodLiteral<"PUB">, z.ZodLiteral<"FIX">]>>>;
|
|
41
|
+
clav3: z.ZodOptional<z.ZodObject<{
|
|
42
|
+
dialect: z.ZodString;
|
|
43
|
+
language: z.ZodString;
|
|
44
|
+
family: z.ZodString;
|
|
45
|
+
creator: z.ZodString;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
part: z.ZodOptional<z.ZodString>;
|
|
48
|
+
example: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
49
|
+
script: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export type Content = z.infer<typeof contentSchema>;
|
|
52
|
+
declare const cotec_json_brand: unique symbol;
|
|
53
|
+
export declare const schema: z.core.$ZodBranded<z.ZodObject<{
|
|
54
|
+
metadata: z.ZodObject<{
|
|
55
|
+
datasize: z.ZodTuple<[z.ZodInt, z.ZodInt], null>;
|
|
56
|
+
title: z.ZodString;
|
|
57
|
+
author: z.ZodArray<z.ZodString>;
|
|
58
|
+
createdDate: z.ZodISODateTime;
|
|
59
|
+
lastUpdate: z.ZodISODateTime;
|
|
60
|
+
jsonLastUpdate: z.ZodISODateTime;
|
|
61
|
+
license: z.ZodObject<{
|
|
62
|
+
name: z.ZodString;
|
|
63
|
+
content: z.ZodString;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
advanced: z.ZodInt;
|
|
66
|
+
label: z.ZodArray<z.ZodString>;
|
|
67
|
+
type: z.ZodArray<z.ZodString>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
contents: z.ZodArray<z.ZodObject<{
|
|
70
|
+
id: z.ZodString;
|
|
71
|
+
messier: z.ZodOptional<z.ZodUnknown>;
|
|
72
|
+
name: z.ZodArray<z.ZodString>;
|
|
73
|
+
kanji: z.ZodArray<z.ZodString>;
|
|
74
|
+
desc: z.ZodArray<z.ZodString>;
|
|
75
|
+
creator: z.ZodArray<z.ZodString>;
|
|
76
|
+
period: z.ZodOptional<z.ZodString>;
|
|
77
|
+
site: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
78
|
+
name: z.ZodOptional<z.ZodString>;
|
|
79
|
+
url: z.ZodURL;
|
|
80
|
+
}, z.core.$strip>>>;
|
|
81
|
+
twitter: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
82
|
+
dict: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
83
|
+
grammar: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
84
|
+
world: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
85
|
+
category: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
86
|
+
name: z.ZodString;
|
|
87
|
+
content: z.ZodOptional<z.ZodString>;
|
|
88
|
+
}, z.core.$strip>>>;
|
|
89
|
+
moyune: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"INT">, z.ZodLiteral<"ART">, z.ZodLiteral<"EXP">, z.ZodLiteral<"PHI">, z.ZodLiteral<"HYP">, z.ZodLiteral<"NAT">, z.ZodLiteral<"REA">, z.ZodLiteral<"IMG">, z.ZodLiteral<"CIN">, z.ZodLiteral<"CDE">, z.ZodLiteral<"GEN">, z.ZodLiteral<"SPE">, z.ZodLiteral<"SON">, z.ZodLiteral<"LIT">, z.ZodLiteral<"KIN">, z.ZodLiteral<"SER">, z.ZodLiteral<"JOK">, z.ZodLiteral<"PAV">, z.ZodLiteral<"AAV">, z.ZodLiteral<"PWL">, z.ZodLiteral<"AWL">, z.ZodLiteral<"TOL">, z.ZodLiteral<"PRI">, z.ZodLiteral<"PUB">, z.ZodLiteral<"FIX">]>>>;
|
|
90
|
+
clav3: z.ZodOptional<z.ZodObject<{
|
|
91
|
+
dialect: z.ZodString;
|
|
92
|
+
language: z.ZodString;
|
|
93
|
+
family: z.ZodString;
|
|
94
|
+
creator: z.ZodString;
|
|
95
|
+
}, z.core.$strip>>;
|
|
96
|
+
part: z.ZodOptional<z.ZodString>;
|
|
97
|
+
example: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
98
|
+
script: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
99
|
+
}, z.core.$strip>>;
|
|
100
|
+
}, z.core.$strip>, typeof cotec_json_brand>;
|
|
101
|
+
export type Data = z.infer<typeof schema>;
|
|
102
|
+
export {};
|
package/dist/main.d.ts
CHANGED
package/dist/util.d.ts
CHANGED
|
@@ -1,20 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export type Result<T, E> = {
|
|
3
|
-
success: true;
|
|
4
|
-
data: T;
|
|
5
|
-
} | {
|
|
6
|
-
success: false;
|
|
7
|
-
error: E;
|
|
8
|
-
};
|
|
9
|
-
declare const misc_err_brand: unique symbol;
|
|
10
|
-
type MiscError<T = unknown> = {
|
|
11
|
-
readonly name: string;
|
|
12
|
-
readonly message: string;
|
|
13
|
-
readonly cause?: T;
|
|
14
|
-
readonly [misc_err_brand]: unknown;
|
|
15
|
-
};
|
|
16
|
-
declare const MiscError: {
|
|
17
|
-
from: <T = unknown>(name?: string, message?: string, cause?: T) => MiscError<T>;
|
|
18
|
-
};
|
|
19
|
-
export { MiscError };
|
|
20
|
-
export declare const parseAndValidate: <T extends z.ZodType>(json: string, schema: T) => Result<z.infer<T>, z.ZodError<z.infer<T>> | MiscError>;
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tktb-tess/my-zod-schema",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "CC0-1.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"dist"
|
|
11
11
|
],
|
|
12
12
|
"engines": {
|
|
13
|
-
"node": "^22
|
|
13
|
+
"node": "^22",
|
|
14
|
+
"pnpm": "^10"
|
|
14
15
|
},
|
|
15
16
|
"main": "./dist/bundle.js",
|
|
16
17
|
"types": "./dist/main.d.ts",
|
|
@@ -18,11 +19,6 @@
|
|
|
18
19
|
"types": "./dist/main.d.ts",
|
|
19
20
|
"import": "./dist/bundle.js"
|
|
20
21
|
},
|
|
21
|
-
"scripts": {
|
|
22
|
-
"dev": "vite",
|
|
23
|
-
"build": "tsc && vite build",
|
|
24
|
-
"test": "vitest run"
|
|
25
|
-
},
|
|
26
22
|
"devDependencies": {
|
|
27
23
|
"@types/node": "^24.3.1",
|
|
28
24
|
"npm-check-updates": "^18.1.1",
|
|
@@ -42,5 +38,12 @@
|
|
|
42
38
|
},
|
|
43
39
|
"volta": {
|
|
44
40
|
"node": "22.19.0"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"dev": "vite",
|
|
44
|
+
"build": "tsc && vite build",
|
|
45
|
+
"test": "vitest run",
|
|
46
|
+
"preinstall": "npx only-allow pnpm",
|
|
47
|
+
"typecheck": "tsc --noEmit"
|
|
45
48
|
}
|
|
46
|
-
}
|
|
49
|
+
}
|