@hedystia/validations 1.10.1 → 1.10.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/dist/index.cjs ADDED
@@ -0,0 +1,15 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_types = require("./types.cjs");
3
+ exports.AnySchemaType = require_types.AnySchemaType;
4
+ exports.ArraySchema = require_types.ArraySchema;
5
+ exports.BaseSchema = require_types.BaseSchema;
6
+ exports.BooleanSchemaType = require_types.BooleanSchemaType;
7
+ exports.InstanceOfSchema = require_types.InstanceOfSchema;
8
+ exports.LiteralSchema = require_types.LiteralSchema;
9
+ exports.NullSchemaType = require_types.NullSchemaType;
10
+ exports.NumberSchemaType = require_types.NumberSchemaType;
11
+ exports.ObjectSchemaType = require_types.ObjectSchemaType;
12
+ exports.OptionalSchema = require_types.OptionalSchema;
13
+ exports.StringSchemaType = require_types.StringSchemaType;
14
+ exports.UnionSchema = require_types.UnionSchema;
15
+ exports.h = require_types.h;
@@ -0,0 +1,2 @@
1
+ import { AnySchema, AnySchemaType, ArraySchema, BaseSchema, BooleanSchemaType, InstanceOfSchema, LiteralSchema, NullSchemaType, NumberSchemaType, ObjectSchemaType, OptionalSchema, StringSchemaType, UnionSchema, h } from "./types.cjs";
2
+ export { AnySchema, AnySchemaType, ArraySchema, BaseSchema, BooleanSchemaType, InstanceOfSchema, LiteralSchema, NullSchemaType, NumberSchemaType, ObjectSchemaType, OptionalSchema, StringSchemaType, UnionSchema, h };
@@ -0,0 +1,2 @@
1
+ import { AnySchema, AnySchemaType, ArraySchema, BaseSchema, BooleanSchemaType, InstanceOfSchema, LiteralSchema, NullSchemaType, NumberSchemaType, ObjectSchemaType, OptionalSchema, StringSchemaType, UnionSchema, h } from "./types.mjs";
2
+ export { AnySchema, AnySchemaType, ArraySchema, BaseSchema, BooleanSchemaType, InstanceOfSchema, LiteralSchema, NullSchemaType, NumberSchemaType, ObjectSchemaType, OptionalSchema, StringSchemaType, UnionSchema, h };
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import { AnySchemaType, ArraySchema, BaseSchema, BooleanSchemaType, InstanceOfSchema, LiteralSchema, NullSchemaType, NumberSchemaType, ObjectSchemaType, OptionalSchema, StringSchemaType, UnionSchema, h } from "./types.mjs";
2
+ export { AnySchemaType, ArraySchema, BaseSchema, BooleanSchemaType, InstanceOfSchema, LiteralSchema, NullSchemaType, NumberSchemaType, ObjectSchemaType, OptionalSchema, StringSchemaType, UnionSchema, h };
package/dist/types.cjs ADDED
@@ -0,0 +1,562 @@
1
+ //#region src/types.ts
2
+ var BaseSchema = class {
3
+ jsonSchema = {};
4
+ get inferred() {
5
+ return null;
6
+ }
7
+ schema = this;
8
+ _coerce = false;
9
+ coerce() {
10
+ this._coerce = true;
11
+ return this;
12
+ }
13
+ optional() {
14
+ return new OptionalSchema(this);
15
+ }
16
+ null() {
17
+ return new UnionSchema(this, new NullSchemaType());
18
+ }
19
+ enum(values) {
20
+ return new UnionSchema(...values.map((value) => new LiteralSchema(value)));
21
+ }
22
+ array() {
23
+ return new ArraySchema(this);
24
+ }
25
+ instanceOf(constructor) {
26
+ return new InstanceOfSchema(this, constructor);
27
+ }
28
+ };
29
+ function validatePrimitive(schema, value) {
30
+ if (typeof value === "string" && schema === "string") return true;
31
+ if (typeof value === "number" && schema === "number" && !Number.isNaN(value)) return true;
32
+ if (typeof value === "boolean" && schema === "boolean") return true;
33
+ return false;
34
+ }
35
+ var StringSchemaType = class StringSchemaType extends BaseSchema {
36
+ type = "string";
37
+ _validateDate = false;
38
+ _validateUUID = false;
39
+ _validateRegex = false;
40
+ _validateEmail = false;
41
+ _validatePhone = false;
42
+ _validateDomain = false;
43
+ _requireHttpOrHttps = false;
44
+ _minLength;
45
+ _maxLength;
46
+ constructor() {
47
+ super();
48
+ this.jsonSchema = { type: "string" };
49
+ }
50
+ primitive() {
51
+ return this.type;
52
+ }
53
+ minLength(n) {
54
+ const schema = new StringSchemaType();
55
+ Object.assign(schema, this);
56
+ schema._minLength = n;
57
+ schema.jsonSchema = {
58
+ ...this.jsonSchema,
59
+ minLength: n
60
+ };
61
+ return schema;
62
+ }
63
+ maxLength(n) {
64
+ const schema = new StringSchemaType();
65
+ Object.assign(schema, this);
66
+ schema._maxLength = n;
67
+ schema.jsonSchema = {
68
+ ...this.jsonSchema,
69
+ maxLength: n
70
+ };
71
+ return schema;
72
+ }
73
+ date() {
74
+ const schema = new StringSchemaType();
75
+ Object.assign(schema, this);
76
+ schema._validateDate = true;
77
+ schema.jsonSchema = {
78
+ ...this.jsonSchema,
79
+ format: "date"
80
+ };
81
+ return schema;
82
+ }
83
+ uuid() {
84
+ const schema = new StringSchemaType();
85
+ schema._validateUUID = true;
86
+ schema.jsonSchema = {
87
+ ...this.jsonSchema,
88
+ format: "uuid"
89
+ };
90
+ return schema;
91
+ }
92
+ regex(regex) {
93
+ const schema = new StringSchemaType();
94
+ schema._validateRegex = true;
95
+ schema.jsonSchema = {
96
+ ...this.jsonSchema,
97
+ pattern: regex.source
98
+ };
99
+ return schema;
100
+ }
101
+ email() {
102
+ const schema = new StringSchemaType();
103
+ schema._validateEmail = true;
104
+ schema.jsonSchema = {
105
+ ...this.jsonSchema,
106
+ format: "email"
107
+ };
108
+ return schema;
109
+ }
110
+ phone() {
111
+ const schema = new StringSchemaType();
112
+ schema._validatePhone = true;
113
+ schema.jsonSchema = {
114
+ ...this.jsonSchema,
115
+ format: "phone"
116
+ };
117
+ return schema;
118
+ }
119
+ domain(requireHttpOrHttps = true) {
120
+ const schema = new StringSchemaType();
121
+ schema._validateDomain = true;
122
+ schema.jsonSchema = {
123
+ ...this.jsonSchema,
124
+ format: "domain"
125
+ };
126
+ schema._requireHttpOrHttps = requireHttpOrHttps;
127
+ return schema;
128
+ }
129
+ "~standard" = {
130
+ version: 1,
131
+ vendor: "h-schema",
132
+ validate: (value) => {
133
+ if (this._coerce && typeof value !== "string") value = String(value);
134
+ if (typeof value !== "string") return { issues: [{ message: `Expected string, received ${typeof value}` }] };
135
+ if (this._minLength !== void 0 && value.length < this._minLength) return { issues: [{ message: `String shorter than ${this._minLength}` }] };
136
+ if (this._maxLength !== void 0 && value.length > this._maxLength) return { issues: [{ message: `String longer than ${this._maxLength}` }] };
137
+ if (this._validateUUID && !this._isValidUUID(value)) return { issues: [{ message: "Invalid UUID format" }] };
138
+ if (this._validateRegex && !this._isValidRegex(value)) return { issues: [{ message: "Invalid regex format" }] };
139
+ if (this._validateEmail && !this._isValidEmail(value)) return { issues: [{ message: "Invalid email format" }] };
140
+ if (this._validatePhone && !this._isValidPhone(value)) return { issues: [{ message: "Invalid phone number format" }] };
141
+ if (this._validateDomain && !this._isValidDomain(value)) return { issues: [{ message: "Invalid domain format" }] };
142
+ if (this._validateDate && !this._isValidDate(value)) return { issues: [{ message: "Invalid date format" }] };
143
+ return { value };
144
+ },
145
+ types: {
146
+ input: {},
147
+ output: {}
148
+ }
149
+ };
150
+ _isValidDate(value) {
151
+ const date = new Date(value);
152
+ return !Number.isNaN(date.getTime());
153
+ }
154
+ _isValidUUID(value) {
155
+ return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value);
156
+ }
157
+ _isValidRegex(value) {
158
+ return new RegExp(this.jsonSchema.pattern).test(value);
159
+ }
160
+ _isValidEmail(value) {
161
+ return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value);
162
+ }
163
+ _isValidPhone(value) {
164
+ return /^\+?[0-9]{7,15}$/.test(value);
165
+ }
166
+ _isValidDomain(value) {
167
+ let domainRegex = /^[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,6}$/;
168
+ if (this._requireHttpOrHttps) domainRegex = /^https?:\/\/[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,6}$/;
169
+ return domainRegex.test(value);
170
+ }
171
+ };
172
+ var NumberSchemaType = class NumberSchemaType extends BaseSchema {
173
+ type = "number";
174
+ _min;
175
+ _max;
176
+ constructor() {
177
+ super();
178
+ this.jsonSchema = { type: "number" };
179
+ }
180
+ primitive() {
181
+ return this.type;
182
+ }
183
+ min(n) {
184
+ const schema = new NumberSchemaType();
185
+ Object.assign(schema, this);
186
+ schema._min = n;
187
+ schema.jsonSchema = {
188
+ ...this.jsonSchema,
189
+ minimum: n
190
+ };
191
+ return schema;
192
+ }
193
+ max(n) {
194
+ const schema = new NumberSchemaType();
195
+ Object.assign(schema, this);
196
+ schema._max = n;
197
+ schema.jsonSchema = {
198
+ ...this.jsonSchema,
199
+ maximum: n
200
+ };
201
+ return schema;
202
+ }
203
+ "~standard" = {
204
+ version: 1,
205
+ vendor: "h-schema",
206
+ validate: (value) => {
207
+ if (this._coerce && typeof value !== "number") {
208
+ const coerced = Number(value);
209
+ if (!Number.isNaN(coerced)) value = coerced;
210
+ }
211
+ if (typeof value !== "number" || Number.isNaN(value)) return { issues: [{ message: `Expected number, received ${typeof value}` }] };
212
+ if (this._min !== void 0 && value < this._min) return { issues: [{ message: `Number less than ${this._min}` }] };
213
+ if (this._max !== void 0 && value > this._max) return { issues: [{ message: `Number greater than ${this._max}` }] };
214
+ return { value };
215
+ },
216
+ types: {
217
+ input: {},
218
+ output: {}
219
+ }
220
+ };
221
+ };
222
+ var BooleanSchemaType = class extends BaseSchema {
223
+ type = "boolean";
224
+ constructor() {
225
+ super();
226
+ this.jsonSchema = { type: "boolean" };
227
+ }
228
+ primitive() {
229
+ return this.type;
230
+ }
231
+ "~standard" = {
232
+ version: 1,
233
+ vendor: "h-schema",
234
+ validate: (value) => {
235
+ if (this._coerce && typeof value !== "boolean") {
236
+ if (value === "true" || value === 1 || value === "1") value = true;
237
+ else if (value === "false" || value === 0 || value === "0") value = false;
238
+ }
239
+ if (typeof value !== "boolean") return { issues: [{ message: `Expected boolean, received ${typeof value}` }] };
240
+ return { value };
241
+ },
242
+ types: {
243
+ input: {},
244
+ output: {}
245
+ }
246
+ };
247
+ };
248
+ var AnySchemaType = class extends BaseSchema {
249
+ type = "any";
250
+ "~standard" = {
251
+ version: 1,
252
+ vendor: "h-schema",
253
+ validate: (value) => {
254
+ return { value };
255
+ },
256
+ types: {
257
+ input: {},
258
+ output: {}
259
+ }
260
+ };
261
+ };
262
+ var LiteralSchema = class extends BaseSchema {
263
+ value;
264
+ constructor(value) {
265
+ super();
266
+ this.value = value;
267
+ this.jsonSchema = {
268
+ const: value,
269
+ type: typeof value
270
+ };
271
+ }
272
+ "~standard" = {
273
+ version: 1,
274
+ vendor: "h-schema",
275
+ validate: (value) => {
276
+ if (value !== this.value) return { issues: [{ message: `Expected literal value ${this.value}, received ${value}` }] };
277
+ return { value };
278
+ },
279
+ types: {
280
+ input: {},
281
+ output: {}
282
+ }
283
+ };
284
+ };
285
+ var OptionalSchema = class extends BaseSchema {
286
+ innerSchema;
287
+ constructor(schema) {
288
+ super();
289
+ this.innerSchema = schema;
290
+ this.jsonSchema = { ...schema.jsonSchema };
291
+ }
292
+ "~standard" = {
293
+ version: 1,
294
+ vendor: "h-schema",
295
+ validate: (value) => {
296
+ if (value === void 0 || value === null) return { value: void 0 };
297
+ return this.innerSchema["~standard"].validate(value);
298
+ },
299
+ types: {
300
+ input: {},
301
+ output: {}
302
+ }
303
+ };
304
+ };
305
+ var NullSchemaType = class extends BaseSchema {
306
+ type = "null";
307
+ constructor() {
308
+ super();
309
+ this.jsonSchema = { type: "null" };
310
+ }
311
+ "~standard" = {
312
+ version: 1,
313
+ vendor: "h-schema",
314
+ validate: (value) => {
315
+ if (value !== null) return { issues: [{ message: `Expected null, received ${value === void 0 ? "undefined" : typeof value}` }] };
316
+ return { value: null };
317
+ },
318
+ types: {
319
+ input: {},
320
+ output: {}
321
+ }
322
+ };
323
+ };
324
+ var UnionSchema = class extends BaseSchema {
325
+ schemas;
326
+ constructor(...schemas) {
327
+ super();
328
+ this.schemas = schemas;
329
+ this.jsonSchema = { anyOf: schemas.map((s) => s.jsonSchema) };
330
+ }
331
+ "~standard" = {
332
+ version: 1,
333
+ vendor: "h-schema",
334
+ validate: (value) => {
335
+ const issuesAccum = [];
336
+ for (const schema of this.schemas) {
337
+ const result = schema["~standard"].validate(value);
338
+ if (!("issues" in result)) return { value: result.value };
339
+ issuesAccum.push(...result.issues);
340
+ }
341
+ return { issues: issuesAccum };
342
+ },
343
+ types: {
344
+ input: {},
345
+ output: {}
346
+ }
347
+ };
348
+ };
349
+ var ArraySchema = class extends BaseSchema {
350
+ innerSchema;
351
+ constructor(schema) {
352
+ super();
353
+ this.innerSchema = schema;
354
+ this.jsonSchema = {
355
+ type: "array",
356
+ items: schema.jsonSchema
357
+ };
358
+ }
359
+ "~standard" = {
360
+ version: 1,
361
+ vendor: "h-schema",
362
+ validate: (value) => {
363
+ if (!Array.isArray(value)) return { issues: [{ message: `Expected array, received ${typeof value}` }] };
364
+ const results = value.map((item, index) => {
365
+ const result = this.innerSchema["~standard"].validate(item);
366
+ if ("issues" in result) return {
367
+ index,
368
+ issues: result.issues?.map((issue) => ({
369
+ ...issue,
370
+ path: issue.path ? [index, ...issue.path] : [index]
371
+ }))
372
+ };
373
+ return {
374
+ index,
375
+ value: result.value
376
+ };
377
+ });
378
+ const errors = results.filter((r) => "issues" in r);
379
+ if (errors.length > 0) return { issues: errors.flatMap((e) => e.issues) };
380
+ return { value: results.map((r) => "value" in r ? r.value : null) };
381
+ },
382
+ types: {
383
+ input: {},
384
+ output: {}
385
+ }
386
+ };
387
+ };
388
+ var InstanceOfSchema = class extends BaseSchema {
389
+ innerSchema;
390
+ classConstructor;
391
+ constructor(schema, classConstructor) {
392
+ super();
393
+ this.innerSchema = schema;
394
+ this.classConstructor = classConstructor;
395
+ this.jsonSchema = {
396
+ ...schema.jsonSchema,
397
+ instanceOf: classConstructor.name
398
+ };
399
+ }
400
+ "~standard" = {
401
+ version: 1,
402
+ vendor: "h-schema",
403
+ validate: (value) => {
404
+ if (!(value instanceof this.classConstructor)) return { issues: [{ message: `Expected instance of ${this.classConstructor.name}` }] };
405
+ return this.innerSchema["~standard"].validate(value);
406
+ },
407
+ types: {
408
+ input: {},
409
+ output: {}
410
+ }
411
+ };
412
+ };
413
+ var ObjectSchemaType = class extends BaseSchema {
414
+ definition;
415
+ constructor(definition) {
416
+ super();
417
+ this.definition = definition;
418
+ const properties = {};
419
+ const required = [];
420
+ for (const key in definition) {
421
+ const schemaItem = definition[key];
422
+ if (!(schemaItem instanceof OptionalSchema)) required.push(key);
423
+ if (typeof schemaItem === "string") properties[key] = { type: schemaItem };
424
+ else if (schemaItem instanceof BaseSchema) properties[key] = schemaItem.jsonSchema;
425
+ else if (typeof schemaItem === "object" && schemaItem !== null) properties[key] = {
426
+ type: "object",
427
+ properties: {}
428
+ };
429
+ }
430
+ this.jsonSchema = {
431
+ type: "object",
432
+ properties,
433
+ required: required.length > 0 ? required : void 0
434
+ };
435
+ }
436
+ "~standard" = {
437
+ version: 1,
438
+ vendor: "h-schema",
439
+ validate: (value) => {
440
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return { issues: [{ message: "Expected object, received " + (value === null ? "null" : Array.isArray(value) ? "array" : typeof value) }] };
441
+ const obj = value;
442
+ const result = {};
443
+ const issues = [];
444
+ for (const key in this.definition) {
445
+ const schemaItem = this.definition[key];
446
+ const isOptional = schemaItem instanceof OptionalSchema;
447
+ if (!(key in obj) && !isOptional) {
448
+ issues.push({
449
+ message: `Missing required property: ${key}`,
450
+ path: [key]
451
+ });
452
+ continue;
453
+ }
454
+ if (key in obj) {
455
+ if (typeof schemaItem === "string" && schemaItem in [
456
+ "string",
457
+ "number",
458
+ "boolean"
459
+ ]) {
460
+ const schemaPrimitive = schemaItem;
461
+ if (!validatePrimitive(schemaPrimitive, obj[key])) issues.push({
462
+ message: `Invalid type for property ${key}: expected ${schemaPrimitive}`,
463
+ path: [key]
464
+ });
465
+ else result[key] = obj[key];
466
+ } else if (schemaItem instanceof BaseSchema) {
467
+ const validationResult = schemaItem["~standard"].validate(obj[key]);
468
+ if ("issues" in validationResult) {
469
+ if (validationResult.issues) issues.push(...validationResult.issues.map((issue) => ({
470
+ ...issue,
471
+ path: issue.path ? [key, ...issue.path] : [key]
472
+ })));
473
+ } else result[key] = validationResult.value;
474
+ }
475
+ }
476
+ }
477
+ if (issues.length > 0) return { issues };
478
+ return { value: result };
479
+ },
480
+ types: {
481
+ input: {},
482
+ output: {}
483
+ }
484
+ };
485
+ };
486
+ function toStandard(schema) {
487
+ let standardSchema;
488
+ if (schema instanceof BaseSchema) standardSchema = schema;
489
+ else if (typeof schema === "string") if (schema === "string") standardSchema = new StringSchemaType();
490
+ else if (schema === "number") standardSchema = new NumberSchemaType();
491
+ else if (schema === "boolean") standardSchema = new BooleanSchemaType();
492
+ else throw new Error("Invalid schema type provided to toStandard");
493
+ else if (typeof schema === "object" && schema !== null && !Array.isArray(schema)) standardSchema = new ObjectSchemaType(schema);
494
+ else throw new Error("Invalid schema type provided to toStandard");
495
+ const z = { toJSONSchema: (schema) => schema.jsonSchema };
496
+ return {
497
+ ...standardSchema,
498
+ inferred: null,
499
+ "~standard": standardSchema["~standard"],
500
+ jsonSchema: z.toJSONSchema(standardSchema),
501
+ schema: standardSchema,
502
+ optional: () => new OptionalSchema(standardSchema),
503
+ enum: standardSchema.enum.bind(standardSchema),
504
+ array: standardSchema.array.bind(standardSchema),
505
+ instanceOf: standardSchema.instanceOf.bind(standardSchema)
506
+ };
507
+ }
508
+ /**
509
+ * Create standard schema types
510
+ * @returns {typeof h} Standard schema types
511
+ */
512
+ const h = {
513
+ string: () => new StringSchemaType(),
514
+ number: () => new NumberSchemaType(),
515
+ boolean: () => new BooleanSchemaType(),
516
+ null: () => new NullSchemaType(),
517
+ any: () => new AnySchemaType(),
518
+ literal: (value) => new LiteralSchema(value),
519
+ object: (schemaDef) => {
520
+ return new ObjectSchemaType(schemaDef || {});
521
+ },
522
+ array: (schema) => {
523
+ return toStandard(schema).array();
524
+ },
525
+ enum: (values) => {
526
+ if (!values || values.length === 0) throw new Error("h.enum() requires a non-empty array of values.");
527
+ const literalSchemas = values.map((val) => h.literal(val));
528
+ return h.options(...literalSchemas);
529
+ },
530
+ optional: (schema) => {
531
+ return toStandard(schema).optional();
532
+ },
533
+ options: (...schemas) => {
534
+ return new UnionSchema(...schemas.map((s) => toStandard(s).schema));
535
+ },
536
+ instanceOf: (constructor) => {
537
+ return h.object({}).instanceOf(constructor);
538
+ },
539
+ date: () => h.string().date(),
540
+ uuid: () => h.string().uuid(),
541
+ regex: (regex) => h.string().regex(regex),
542
+ email: () => h.string().email(),
543
+ phone: () => h.string().phone(),
544
+ domain: (requireHttpOrHttps = true) => h.string().domain(requireHttpOrHttps),
545
+ toStandard
546
+ };
547
+ //#endregion
548
+ exports.AnySchemaType = AnySchemaType;
549
+ exports.ArraySchema = ArraySchema;
550
+ exports.BaseSchema = BaseSchema;
551
+ exports.BooleanSchemaType = BooleanSchemaType;
552
+ exports.InstanceOfSchema = InstanceOfSchema;
553
+ exports.LiteralSchema = LiteralSchema;
554
+ exports.NullSchemaType = NullSchemaType;
555
+ exports.NumberSchemaType = NumberSchemaType;
556
+ exports.ObjectSchemaType = ObjectSchemaType;
557
+ exports.OptionalSchema = OptionalSchema;
558
+ exports.StringSchemaType = StringSchemaType;
559
+ exports.UnionSchema = UnionSchema;
560
+ exports.h = h;
561
+
562
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.cjs","names":[],"sources":["../src/types.ts"],"sourcesContent":["import type { StandardSchemaV1 } from \"@standard-schema/spec\";\n\ntype SchemaPrimitive = \"string\" | \"number\" | \"boolean\" | \"any\";\n\ninterface SchemaLike {\n [key: string]: SchemaPrimitive | SchemaLike | BaseSchema<any, any>;\n}\n\ntype Simplify<T> = T extends any ? { [K in keyof T]: T[K] } : never;\n\ntype RequiredKeys<S> = {\n [K in keyof S]: S[K] extends OptionalSchema<any, any> ? never : K;\n}[keyof S];\n\ntype OptionalKeys<S> = {\n [K in keyof S]: S[K] extends OptionalSchema<any, any> ? K : never;\n}[keyof S];\n\ntype SchemaPrimitiveMap = {\n string: string;\n number: number;\n boolean: boolean;\n any: unknown;\n};\n\ntype SchemaType<S> =\n S extends BaseSchema<any, infer O>\n ? O\n : S extends keyof SchemaPrimitiveMap\n ? SchemaPrimitiveMap[S]\n : S extends Record<string, any>\n ? InferSchema<S>\n : unknown;\n\ntype InferObject<S extends SchemaDefinition> = Simplify<\n {\n [K in RequiredKeys<S>]: SchemaType<S[K]>;\n } & {\n [K in OptionalKeys<S>]?: SchemaType<S[K]>;\n }\n>;\n\ntype InferSchema<S> =\n S extends BaseSchema<any, infer O>\n ? O\n : S extends \"string\"\n ? string\n : S extends \"number\"\n ? number\n : S extends \"boolean\"\n ? boolean\n : S extends { [key: string]: any }\n ? {\n [K in keyof S as undefined extends InferSchema<S[K]> ? K : never]?: InferSchema<\n S[K]\n >;\n } & {\n [K in keyof S as undefined extends InferSchema<S[K]> ? never : K]: InferSchema<\n S[K]\n >;\n }\n : unknown;\n\ntype SchemaDefinition = SchemaLike;\n\ninterface Schema<I, O> extends StandardSchemaV1<I, O> {\n optional(): OptionalSchema<I, O | undefined>;\n enum<V extends O & (string | number | boolean), Values extends readonly [V, ...V[]]>(\n values: Values,\n ): UnionSchema<I, Values[number]>;\n array(): ArraySchema<I, O[]>;\n instanceOf<C extends new (...args: any[]) => any>(\n constructor: C,\n ): InstanceOfSchema<I, InstanceType<C>>;\n jsonSchema: any;\n readonly inferred: O;\n schema: Schema<I, O>;\n}\n\nexport abstract class BaseSchema<I, O> implements Schema<I, O> {\n abstract readonly \"~standard\": StandardSchemaV1.Props<I, O>;\n jsonSchema: any = {};\n get inferred(): O {\n return null as unknown as O;\n }\n schema: Schema<I, O> = this;\n protected _coerce = false;\n\n coerce(): this {\n this._coerce = true;\n return this;\n }\n\n optional(): OptionalSchema<I, O | undefined> {\n return new OptionalSchema<I, O>(this);\n }\n\n null(): UnionSchema<I, O | null> {\n return new UnionSchema<I, O | null>(this, new NullSchemaType() as any);\n }\n\n enum<V extends O & (string | number | boolean), Values extends readonly [V, ...V[]]>(\n values: Values,\n ): UnionSchema<I, Values[number]> {\n const literalSchemas = values.map((value) => new LiteralSchema<I, V>(value));\n return new UnionSchema<I, Values[number]>(...literalSchemas);\n }\n\n array(): ArraySchema<I, O[]> {\n return new ArraySchema<I, O[]>(this);\n }\n\n instanceOf<C extends new (...args: any[]) => any>(\n constructor: C,\n ): InstanceOfSchema<I, InstanceType<C>> {\n return new InstanceOfSchema<I, InstanceType<C>>(this, constructor);\n }\n}\n\nfunction validatePrimitive(schema: SchemaPrimitive, value: unknown): boolean {\n if (typeof value === \"string\" && schema === \"string\") {\n return true;\n }\n if (typeof value === \"number\" && schema === \"number\" && !Number.isNaN(value)) {\n return true;\n }\n if (typeof value === \"boolean\" && schema === \"boolean\") {\n return true;\n }\n return false;\n}\n\nexport class StringSchemaType extends BaseSchema<unknown, string> {\n readonly type: SchemaPrimitive = \"string\";\n private _validateDate = false;\n private _validateUUID = false;\n private _validateRegex = false;\n private _validateEmail = false;\n private _validatePhone = false;\n private _validateDomain = false;\n private _requireHttpOrHttps = false;\n private _minLength?: number;\n private _maxLength?: number;\n\n constructor() {\n super();\n this.jsonSchema = { type: \"string\" };\n }\n\n primitive(): SchemaPrimitive {\n return this.type;\n }\n\n minLength(n: number): StringSchemaType {\n const schema = new StringSchemaType();\n Object.assign(schema, this);\n schema._minLength = n;\n schema.jsonSchema = {\n ...this.jsonSchema,\n minLength: n,\n };\n return schema;\n }\n\n maxLength(n: number): StringSchemaType {\n const schema = new StringSchemaType();\n Object.assign(schema, this);\n schema._maxLength = n;\n schema.jsonSchema = {\n ...this.jsonSchema,\n maxLength: n,\n };\n return schema;\n }\n\n date(): StringSchemaType {\n const schema = new StringSchemaType();\n Object.assign(schema, this);\n schema._validateDate = true;\n schema.jsonSchema = { ...this.jsonSchema, format: \"date\" };\n return schema;\n }\n\n uuid(): StringSchemaType {\n const schema = new StringSchemaType();\n schema._validateUUID = true;\n schema.jsonSchema = { ...this.jsonSchema, format: \"uuid\" };\n return schema;\n }\n\n regex(regex: RegExp): StringSchemaType {\n const schema = new StringSchemaType();\n schema._validateRegex = true;\n schema.jsonSchema = { ...this.jsonSchema, pattern: regex.source };\n return schema;\n }\n\n email(): StringSchemaType {\n const schema = new StringSchemaType();\n schema._validateEmail = true;\n schema.jsonSchema = { ...this.jsonSchema, format: \"email\" };\n return schema;\n }\n\n phone(): StringSchemaType {\n const schema = new StringSchemaType();\n schema._validatePhone = true;\n schema.jsonSchema = { ...this.jsonSchema, format: \"phone\" };\n return schema;\n }\n\n domain(requireHttpOrHttps = true): StringSchemaType {\n const schema = new StringSchemaType();\n schema._validateDomain = true;\n schema.jsonSchema = { ...this.jsonSchema, format: \"domain\" };\n schema._requireHttpOrHttps = requireHttpOrHttps;\n return schema;\n }\n\n readonly \"~standard\": StandardSchemaV1.Props<unknown, string> = {\n version: 1,\n vendor: \"h-schema\",\n validate: (value: unknown) => {\n if (this._coerce && typeof value !== \"string\") {\n value = String(value);\n }\n\n if (typeof value !== \"string\") {\n return {\n issues: [{ message: `Expected string, received ${typeof value}` }],\n };\n }\n\n if (this._minLength !== undefined && value.length < this._minLength) {\n return { issues: [{ message: `String shorter than ${this._minLength}` }] };\n }\n\n if (this._maxLength !== undefined && value.length > this._maxLength) {\n return { issues: [{ message: `String longer than ${this._maxLength}` }] };\n }\n\n if (this._validateUUID && !this._isValidUUID(value)) {\n return {\n issues: [{ message: \"Invalid UUID format\" }],\n };\n }\n\n if (this._validateRegex && !this._isValidRegex(value)) {\n return {\n issues: [{ message: \"Invalid regex format\" }],\n };\n }\n\n if (this._validateEmail && !this._isValidEmail(value)) {\n return {\n issues: [{ message: \"Invalid email format\" }],\n };\n }\n\n if (this._validatePhone && !this._isValidPhone(value)) {\n return {\n issues: [{ message: \"Invalid phone number format\" }],\n };\n }\n\n if (this._validateDomain && !this._isValidDomain(value)) {\n return {\n issues: [{ message: \"Invalid domain format\" }],\n };\n }\n\n if (this._validateDate && !this._isValidDate(value)) {\n return { issues: [{ message: \"Invalid date format\" }] };\n }\n\n return { value };\n },\n types: {\n input: {} as unknown,\n output: {} as string,\n },\n };\n\n private _isValidDate(value: string): boolean {\n const date = new Date(value);\n return !Number.isNaN(date.getTime());\n }\n\n private _isValidUUID(value: string): boolean {\n const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;\n return uuidRegex.test(value);\n }\n\n private _isValidRegex(value: string): boolean {\n return new RegExp(this.jsonSchema.pattern!).test(value);\n }\n\n private _isValidEmail(value: string): boolean {\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n return emailRegex.test(value);\n }\n\n private _isValidPhone(value: string): boolean {\n const phoneRegex = /^\\+?[0-9]{7,15}$/;\n return phoneRegex.test(value);\n }\n\n private _isValidDomain(value: string): boolean {\n let domainRegex = /^[a-z0-9]+([-.]{1}[a-z0-9]+)*\\.[a-z]{2,6}$/;\n if (this._requireHttpOrHttps) {\n domainRegex = /^https?:\\/\\/[a-z0-9]+([-.]{1}[a-z0-9]+)*\\.[a-z]{2,6}$/;\n }\n return domainRegex.test(value);\n }\n}\n\nexport class NumberSchemaType extends BaseSchema<unknown, number> {\n readonly type: SchemaPrimitive = \"number\";\n private _min?: number;\n private _max?: number;\n\n constructor() {\n super();\n this.jsonSchema = { type: \"number\" };\n }\n\n primitive(): SchemaPrimitive {\n return this.type;\n }\n\n min(n: number): NumberSchemaType {\n const schema = new NumberSchemaType();\n Object.assign(schema, this);\n schema._min = n;\n schema.jsonSchema = {\n ...this.jsonSchema,\n minimum: n,\n };\n return schema;\n }\n\n max(n: number): NumberSchemaType {\n const schema = new NumberSchemaType();\n Object.assign(schema, this);\n schema._max = n;\n schema.jsonSchema = {\n ...this.jsonSchema,\n maximum: n,\n };\n return schema;\n }\n\n readonly \"~standard\": StandardSchemaV1.Props<unknown, number> = {\n version: 1,\n vendor: \"h-schema\",\n validate: (value: unknown) => {\n if (this._coerce && typeof value !== \"number\") {\n const coerced = Number(value);\n if (!Number.isNaN(coerced)) {\n value = coerced;\n }\n }\n if (typeof value !== \"number\" || Number.isNaN(value)) {\n return {\n issues: [{ message: `Expected number, received ${typeof value}` }],\n };\n }\n if (this._min !== undefined && value < this._min) {\n return { issues: [{ message: `Number less than ${this._min}` }] };\n }\n if (this._max !== undefined && value > this._max) {\n return { issues: [{ message: `Number greater than ${this._max}` }] };\n }\n return { value };\n },\n types: {\n input: {} as unknown,\n output: {} as number,\n },\n };\n}\n\nexport class BooleanSchemaType extends BaseSchema<unknown, boolean> {\n readonly type: SchemaPrimitive = \"boolean\";\n\n constructor() {\n super();\n this.jsonSchema = { type: \"boolean\" };\n }\n\n primitive(): SchemaPrimitive {\n return this.type;\n }\n\n readonly \"~standard\": StandardSchemaV1.Props<unknown, boolean> = {\n version: 1,\n vendor: \"h-schema\",\n validate: (value: unknown) => {\n if (this._coerce && typeof value !== \"boolean\") {\n if (value === \"true\" || value === 1 || value === \"1\") {\n value = true;\n } else if (value === \"false\" || value === 0 || value === \"0\") {\n value = false;\n }\n }\n if (typeof value !== \"boolean\") {\n return {\n issues: [{ message: `Expected boolean, received ${typeof value}` }],\n };\n }\n return { value };\n },\n types: {\n input: {} as unknown,\n output: {} as boolean,\n },\n };\n}\n\nexport class AnySchemaType extends BaseSchema<unknown, any> {\n readonly type: SchemaPrimitive = \"any\";\n readonly \"~standard\": StandardSchemaV1.Props<unknown, any> = {\n version: 1,\n vendor: \"h-schema\",\n validate: (value: unknown) => {\n return { value };\n },\n types: {\n input: {} as unknown,\n output: {} as any,\n },\n };\n}\n\nexport class LiteralSchema<I, T extends string | number | boolean> extends BaseSchema<I, T> {\n private readonly value: T;\n\n constructor(value: T) {\n super();\n this.value = value;\n this.jsonSchema = {\n const: value,\n type: typeof value as \"string\" | \"number\" | \"boolean\",\n };\n }\n\n readonly \"~standard\": StandardSchemaV1.Props<I, T> = {\n version: 1,\n vendor: \"h-schema\",\n validate: (value: unknown) => {\n if (value !== this.value) {\n return {\n issues: [{ message: `Expected literal value ${this.value}, received ${value}` }],\n };\n }\n return { value: value as T };\n },\n types: {\n input: {} as I,\n output: {} as T,\n },\n };\n}\n\nexport class OptionalSchema<I, O> extends BaseSchema<I, O | undefined> {\n private readonly innerSchema: Schema<I, O>;\n\n constructor(schema: Schema<I, O>) {\n super();\n this.innerSchema = schema;\n this.jsonSchema = { ...schema.jsonSchema };\n }\n\n readonly \"~standard\": StandardSchemaV1.Props<I, O | undefined> = {\n version: 1,\n vendor: \"h-schema\",\n validate: (value: unknown) => {\n if (value === undefined || value === null) {\n return { value: undefined };\n }\n\n const result = this.innerSchema[\"~standard\"].validate(value);\n return result;\n },\n types: {\n input: {} as I,\n output: {} as O | undefined,\n },\n };\n}\n\nexport class NullSchemaType extends BaseSchema<unknown, null> {\n readonly type = \"null\";\n constructor() {\n super();\n this.jsonSchema = { type: \"null\" };\n }\n\n readonly \"~standard\": StandardSchemaV1.Props<unknown, null> = {\n version: 1,\n vendor: \"h-schema\",\n validate: (value: unknown) => {\n if (value !== null) {\n return {\n issues: [\n {\n message: `Expected null, received ${value === undefined ? \"undefined\" : typeof value}`,\n },\n ],\n };\n }\n return { value: null };\n },\n types: {\n input: {} as unknown,\n output: {} as unknown as null,\n },\n };\n}\n\nexport class UnionSchema<I, O> extends BaseSchema<I, O> {\n private readonly schemas: Schema<I, any>[];\n constructor(...schemas: Schema<I, any>[]) {\n super();\n this.schemas = schemas;\n this.jsonSchema = { anyOf: schemas.map((s) => s.jsonSchema) };\n }\n\n readonly \"~standard\": StandardSchemaV1.Props<I, O> = {\n version: 1,\n vendor: \"h-schema\",\n validate: (value: unknown) => {\n const issuesAccum: StandardSchemaV1.Issue[] = [];\n for (const schema of this.schemas) {\n const result = schema[\"~standard\"].validate(value) as StandardSchemaV1.Result<any>;\n if (!(\"issues\" in result)) {\n return { value: result.value };\n }\n issuesAccum.push(...result.issues!);\n }\n return { issues: issuesAccum };\n },\n types: {\n input: {} as I,\n output: {} as O,\n },\n };\n}\n\nexport class ArraySchema<I, O extends any[]> extends BaseSchema<I, O> {\n private readonly innerSchema: Schema<I, O[number]>;\n\n constructor(schema: Schema<I, O[number]>) {\n super();\n this.innerSchema = schema;\n this.jsonSchema = { type: \"array\", items: schema.jsonSchema };\n }\n\n readonly \"~standard\": StandardSchemaV1.Props<I, O> = {\n version: 1,\n vendor: \"h-schema\",\n validate: (value: unknown) => {\n if (!Array.isArray(value)) {\n return {\n issues: [{ message: `Expected array, received ${typeof value}` }],\n };\n }\n\n const results = value.map((item, index) => {\n const result = this.innerSchema[\"~standard\"].validate(item) as StandardSchemaV1.Result<\n O[number]\n >;\n if (\"issues\" in result) {\n return {\n index,\n issues: result.issues?.map((issue) => ({\n ...issue,\n path: issue.path ? [index, ...issue.path] : [index],\n })),\n };\n }\n return { index, value: result.value };\n });\n\n const errors = results.filter((r) => \"issues\" in r) as {\n index: number;\n issues: StandardSchemaV1.Issue[];\n }[];\n\n if (errors.length > 0) {\n return {\n issues: errors.flatMap((e) => e.issues),\n };\n }\n\n return { value: results.map((r) => (\"value\" in r ? r.value : null)) as O };\n },\n types: {\n input: {} as I,\n output: {} as O,\n },\n };\n}\n\nexport class InstanceOfSchema<I, O> extends BaseSchema<I, O> {\n private readonly innerSchema: Schema<I, any>;\n private readonly classConstructor: new (\n ...args: any[]\n ) => any;\n\n constructor(schema: Schema<I, any>, classConstructor: new (...args: any[]) => any) {\n super();\n this.innerSchema = schema;\n this.classConstructor = classConstructor;\n this.jsonSchema = { ...schema.jsonSchema, instanceOf: classConstructor.name };\n }\n\n readonly \"~standard\": StandardSchemaV1.Props<I, O> = {\n version: 1,\n vendor: \"h-schema\",\n validate: (value: unknown) => {\n if (!(value instanceof this.classConstructor)) {\n return {\n issues: [\n {\n message: `Expected instance of ${this.classConstructor.name}`,\n },\n ],\n };\n }\n\n const result = this.innerSchema[\"~standard\"].validate(value);\n return result as StandardSchemaV1.Result<O>;\n },\n types: {\n input: {} as I,\n output: {} as O,\n },\n };\n}\n\nexport class ObjectSchemaType<T extends Record<string, unknown>> extends BaseSchema<unknown, T> {\n readonly definition: SchemaDefinition;\n\n constructor(definition: SchemaDefinition) {\n super();\n this.definition = definition;\n\n const properties: Record<string, any> = {};\n const required: string[] = [];\n\n for (const key in definition) {\n const schemaItem = definition[key];\n const isOptional = schemaItem instanceof OptionalSchema;\n\n if (!isOptional) {\n required.push(key);\n }\n\n if (typeof schemaItem === \"string\") {\n properties[key] = { type: schemaItem };\n } else if (schemaItem instanceof BaseSchema) {\n properties[key] = schemaItem.jsonSchema;\n } else if (typeof schemaItem === \"object\" && schemaItem !== null) {\n properties[key] = { type: \"object\", properties: {} };\n }\n }\n\n this.jsonSchema = {\n type: \"object\",\n properties,\n required: required.length > 0 ? required : undefined,\n };\n }\n\n readonly \"~standard\": StandardSchemaV1.Props<unknown, T> = {\n version: 1,\n vendor: \"h-schema\",\n validate: (value: unknown): StandardSchemaV1.Result<T> => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return {\n issues: [\n {\n message:\n \"Expected object, received \" +\n (value === null ? \"null\" : Array.isArray(value) ? \"array\" : typeof value),\n },\n ],\n };\n }\n\n const obj = value as Record<string, unknown>;\n const result: Record<string, unknown> = {};\n const issues: StandardSchemaV1.Issue[] = [];\n\n for (const key in this.definition) {\n const schemaItem = this.definition[key];\n const isOptional = schemaItem instanceof OptionalSchema;\n\n if (!(key in obj) && !isOptional) {\n issues.push({\n message: `Missing required property: ${key}`,\n path: [key],\n });\n continue;\n }\n\n if (key in obj) {\n if (typeof schemaItem === \"string\" && schemaItem in [\"string\", \"number\", \"boolean\"]) {\n const schemaPrimitive = schemaItem as SchemaPrimitive;\n if (!validatePrimitive(schemaPrimitive, obj[key])) {\n issues.push({\n message: `Invalid type for property ${key}: expected ${schemaPrimitive}`,\n path: [key],\n });\n } else {\n result[key] = obj[key];\n }\n } else if (schemaItem instanceof BaseSchema) {\n const validationResult = schemaItem[\"~standard\"].validate(\n obj[key],\n ) as StandardSchemaV1.Result<any>;\n if (\"issues\" in validationResult) {\n if (validationResult.issues) {\n issues.push(\n ...validationResult.issues.map((issue) => ({\n ...issue,\n path: issue.path ? [key, ...issue.path] : [key],\n })),\n );\n }\n } else {\n result[key] = validationResult.value;\n }\n }\n }\n }\n\n if (issues.length > 0) {\n return { issues };\n }\n\n return { value: result as T };\n },\n types: {\n input: {} as unknown,\n output: {} as T,\n },\n };\n}\n\nexport type AnySchema = SchemaPrimitive | BaseSchema<any, any> | SchemaDefinition;\n\nfunction toStandard<T>(schema: AnySchema): Schema<unknown, T> {\n let standardSchema: Schema<unknown, T>;\n\n if (schema instanceof BaseSchema) {\n standardSchema = schema as Schema<unknown, T>;\n } else if (typeof schema === \"string\") {\n if (schema === \"string\") {\n standardSchema = new StringSchemaType() as unknown as Schema<unknown, T>;\n } else if (schema === \"number\") {\n standardSchema = new NumberSchemaType() as unknown as Schema<unknown, T>;\n } else if (schema === \"boolean\") {\n standardSchema = new BooleanSchemaType() as unknown as Schema<unknown, T>;\n } else {\n throw new Error(\"Invalid schema type provided to toStandard\");\n }\n } else if (typeof schema === \"object\" && schema !== null && !Array.isArray(schema)) {\n standardSchema = new ObjectSchemaType<any>(schema as SchemaDefinition) as Schema<unknown, T>;\n } else {\n throw new Error(\"Invalid schema type provided to toStandard\");\n }\n\n const z = {\n toJSONSchema: (schema: any) => schema.jsonSchema,\n };\n\n return {\n ...standardSchema,\n inferred: null as unknown as T,\n \"~standard\": standardSchema[\"~standard\"],\n jsonSchema: z.toJSONSchema(standardSchema),\n schema: standardSchema,\n optional: () => new OptionalSchema<unknown, T>(standardSchema),\n enum: standardSchema.enum.bind(standardSchema),\n array: standardSchema.array.bind(standardSchema),\n instanceOf: standardSchema.instanceOf.bind(standardSchema),\n };\n}\n\n/**\n * Create standard schema types\n * @returns {typeof h} Standard schema types\n */\nexport const h = {\n /**\n * Create string schema type\n * @returns {StringSchemaType} String schema type\n */\n string: (): StringSchemaType => new StringSchemaType(),\n /**\n * Create number schema type\n * @returns {NumberSchemaType} Number schema type\n */\n number: (): NumberSchemaType => new NumberSchemaType(),\n /**\n * Create boolean schema type\n * @returns {BooleanSchemaType} Boolean schema type\n */\n boolean: (): BooleanSchemaType => new BooleanSchemaType(),\n /**\n * Create null schema type\n * @returns {NullSchemaType} Null schema type\n */\n null: (): NullSchemaType => new NullSchemaType(),\n\n /**\n * Create any schema type\n * @returns {AnySchemaType} Any schema type\n */\n any: (): AnySchemaType => new AnySchemaType(),\n\n /**\n * Create literal schema type\n * @param {T} value - Literal value\n * @returns {LiteralSchema<unknown, T>} Literal schema type\n */\n literal: <T extends string | number | boolean>(value: T): LiteralSchema<unknown, T> =>\n new LiteralSchema<unknown, T>(value),\n\n /**\n * Create object schema type\n * @param {S} [schemaDef] - Schema definition\n * @returns {ObjectSchemaType<InferObject<S>>} Object schema type\n */\n object: <S extends SchemaDefinition>(schemaDef?: S): ObjectSchemaType<InferObject<S>> => {\n return new ObjectSchemaType(schemaDef || {}) as ObjectSchemaType<InferObject<S>>;\n },\n\n /**\n * Create array schema type\n * @param {S} schema - Schema\n * @returns {ArraySchema<unknown, InferSchema<S>[]>} Array schema type\n */\n array: <S extends AnySchema>(schema: S): ArraySchema<unknown, SchemaType<S>[]> => {\n const base = toStandard<SchemaType<S>>(schema);\n return base.array() as ArraySchema<unknown, SchemaType<S>[]>;\n },\n\n /**\n * Create enum schema type from a list of string, number or boolean values.\n * @param {Values} values - An array of literal values.\n * @returns {UnionSchema<unknown, Values[number]>} A schema that validates against one of the provided literal values.\n */\n enum: <T extends string | number | boolean, Values extends readonly [T, ...T[]]>(\n values: Values,\n ): UnionSchema<unknown, Values[number]> => {\n if (!values || values.length === 0) {\n throw new Error(\"h.enum() requires a non-empty array of values.\");\n }\n const literalSchemas = values.map((val) => h.literal(val));\n return h.options(...literalSchemas) as UnionSchema<unknown, Values[number]>;\n },\n\n /**\n * Create optional schema type\n * @param {S} schema - Schema\n * @returns {OptionalSchema<unknown, InferSchema<S> | undefined>} Optional schema type\n */\n optional: <S extends AnySchema>(\n schema: S,\n ): OptionalSchema<unknown, InferSchema<S> | undefined> => {\n return toStandard<InferSchema<S>>(schema).optional();\n },\n\n /**\n * Create options schema type\n * @param {S} schemas - Schemas\n * @returns {UnionSchema<unknown, InferSchema<S[number]>>} Options schema type\n */\n options: <S extends AnySchema[]>(...schemas: S): UnionSchema<unknown, InferSchema<S[number]>> => {\n const stdSchemas = schemas.map((s) => toStandard<InferSchema<S[number]>>(s).schema);\n return new UnionSchema<unknown, InferSchema<S[number]>>(...stdSchemas);\n },\n\n /**\n * Create instance of schema type\n * @param {C} constructor - Constructor function\n * @returns {InstanceOfSchema<unknown, InstanceType<C>>} Instance of schema type\n */\n instanceOf: <C extends new (...args: any[]) => any>(\n constructor: C,\n ): InstanceOfSchema<unknown, InstanceType<C>> => {\n const baseSchema = h.object({});\n return baseSchema.instanceOf(constructor);\n },\n\n /**\n * Create date schema type\n * @returns {StringSchemaType} Date schema type\n */\n date: (): StringSchemaType => h.string().date(),\n\n /**\n * Create UUID schema type\n * @returns {StringSchemaType} UUID schema type\n */\n uuid: (): StringSchemaType => h.string().uuid(),\n\n /**\n * Create regex schema type\n * @param {RegExp} regex - Regex\n * @returns {StringSchemaType} Regex schema type\n */\n regex: (regex: RegExp): StringSchemaType => h.string().regex(regex),\n\n /**\n * Create email schema type\n * @returns {StringSchemaType} Email schema type\n */\n email: (): StringSchemaType => h.string().email(),\n\n /**\n * Create phone schema type\n * @returns {StringSchemaType} Phone schema type\n */\n phone: (): StringSchemaType => h.string().phone(),\n\n /** Create domain schema type\n * @param {boolean} requireHttpOrHttps - Require http or https\n * @returns {StringSchemaType} Domain schema type\n */\n domain: (requireHttpOrHttps = true): StringSchemaType => h.string().domain(requireHttpOrHttps),\n\n /**\n * Convert schema to standard schema\n * @param {AnySchema} schema - Schema\n * @returns {Schema<unknown, any>} Standard schema\n */\n toStandard: toStandard,\n};\n"],"mappings":";AA+EA,IAAsB,aAA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