@forklaunch/validator 0.1.14 → 0.1.15

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +9 -14
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -11,18 +11,13 @@ import { TCatchall, TObject, TObjectShape, TOuterArray, TResolve, TSchemaTransla
11
11
  import { IdiomaticSchema } from "./types/schema.types";
12
12
  import { ZodSchemaValidator } from "./zod";
13
13
  import { ZodCatchall, ZodObject, ZodObjectShape, ZodOuterArray, ZodResolve, ZodSchemaTranslate } from "./zod/types/zod.schema.types";
14
- /**
15
- * Interface representing any schema validator.
16
- * Extends the SchemaValidator interface with any schema types.
17
- */
18
- type AnySchemaValidator = SchemaValidator;
19
14
  /**
20
15
  * Type alias for a schema object shape.
21
16
  * Resolves to ZodObjectShape for Zod schemas and TObjectShape for TypeBox schemas.
22
17
  *
23
18
  * @template SV - SchemaValidator type.
24
19
  */
25
- type SchemaObjectShape<SV extends AnySchemaValidator> = (SV extends ZodSchemaValidator ? ZodObjectShape : SV extends TypeboxSchemaValidator ? TObjectShape : never);
20
+ type SchemaObjectShape<SV extends SchemaValidator> = (SV extends ZodSchemaValidator ? ZodObjectShape : SV extends TypeboxSchemaValidator ? TObjectShape : never);
26
21
  /**
27
22
  * Type alias for a schema object.
28
23
  * Resolves to ZodObject for Zod schemas and TObject for TypeBox schemas.
@@ -30,7 +25,7 @@ type SchemaObjectShape<SV extends AnySchemaValidator> = (SV extends ZodSchemaVal
30
25
  * @template T - Schema object shape.
31
26
  * @template SV - SchemaValidator type.
32
27
  */
33
- type SchemaObject<T extends SchemaObjectShape<SV>, SV extends AnySchemaValidator> = (SV extends ZodSchemaValidator ? ZodObject<T> : SV extends TypeboxSchemaValidator ? TObject<T> : never);
28
+ type SchemaObject<T extends SchemaObjectShape<SV>, SV extends SchemaValidator> = (SV extends ZodSchemaValidator ? ZodObject<T> : SV extends TypeboxSchemaValidator ? TObject<T> : never);
34
29
  /**
35
30
  * Type alias for a schema outer array.
36
31
  * Resolves to ZodOuterArray for Zod schemas and TOuterArray for TypeBox schemas.
@@ -38,7 +33,7 @@ type SchemaObject<T extends SchemaObjectShape<SV>, SV extends AnySchemaValidator
38
33
  * @template T - Schema object.
39
34
  * @template SV - SchemaValidator type.
40
35
  */
41
- type SchemaOuterArray<T extends SchemaObject<SchemaObjectShape<SV>, SV>, SV extends AnySchemaValidator> = (SV extends ZodSchemaValidator ? ZodOuterArray<T> : SV extends TypeboxSchemaValidator ? TOuterArray<T> : never);
36
+ type SchemaOuterArray<T extends SchemaObject<SchemaObjectShape<SV>, SV>, SV extends SchemaValidator> = (SV extends ZodSchemaValidator ? ZodOuterArray<T> : SV extends TypeboxSchemaValidator ? TOuterArray<T> : never);
42
37
  /**
43
38
  * Type alias for resolving a schema.
44
39
  * Resolves to ZodResolve for Zod schemas and TResolve for TypeBox schemas.
@@ -46,7 +41,7 @@ type SchemaOuterArray<T extends SchemaObject<SchemaObjectShape<SV>, SV>, SV exte
46
41
  * @template T - Schema type.
47
42
  * @template SV - SchemaValidator type.
48
43
  */
49
- type SchemaResolve<T, SV extends AnySchemaValidator> = (SV extends ZodSchemaValidator ? ZodResolve<T> : SV extends TypeboxSchemaValidator ? TResolve<T> : never);
44
+ type SchemaResolve<T, SV extends SchemaValidator> = (SV extends ZodSchemaValidator ? ZodResolve<T> : SV extends TypeboxSchemaValidator ? TResolve<T> : never);
50
45
  /**
51
46
  * Type alias for translating a schema.
52
47
  * Resolves to ZodSchemaTranslate for Zod schemas and TSchemaTranslate for TypeBox schemas.
@@ -54,7 +49,7 @@ type SchemaResolve<T, SV extends AnySchemaValidator> = (SV extends ZodSchemaVali
54
49
  * @template T - Schema type.
55
50
  * @template SV - SchemaValidator type.
56
51
  */
57
- type SchemaTranslate<T, SV extends AnySchemaValidator> = (SV extends ZodSchemaValidator ? ZodSchemaTranslate<T> : SV extends TypeboxSchemaValidator ? TSchemaTranslate<T> : never);
52
+ type SchemaTranslate<T, SV extends SchemaValidator> = (SV extends ZodSchemaValidator ? ZodSchemaTranslate<T> : SV extends TypeboxSchemaValidator ? TSchemaTranslate<T> : never);
58
53
  /**
59
54
  * Type alias for prettifying a schema translation.
60
55
  * Uses the Prettify utility from @forklaunch/common.
@@ -62,21 +57,21 @@ type SchemaTranslate<T, SV extends AnySchemaValidator> = (SV extends ZodSchemaVa
62
57
  * @template T - Schema type.
63
58
  * @template SV - SchemaValidator type.
64
59
  */
65
- type SchemaPrettify<T, SV extends AnySchemaValidator> = Prettify<SchemaTranslate<T, SV>>;
60
+ type SchemaPrettify<T, SV extends SchemaValidator> = Prettify<SchemaTranslate<T, SV>>;
66
61
  /**
67
62
  * Type alias for a schema catchall type.
68
63
  * Resolves to ZodCatchall for Zod schemas and TCatchall for TypeBox schemas.
69
64
  *
70
65
  * @template SV - SchemaValidator type.
71
66
  */
72
- export type SchemaCatchall<SV extends AnySchemaValidator> = (SV extends ZodSchemaValidator ? ZodCatchall : SV extends TypeboxSchemaValidator ? TCatchall : never);
67
+ export type SchemaCatchall<SV extends SchemaValidator> = (SV extends ZodSchemaValidator ? ZodCatchall : SV extends TypeboxSchemaValidator ? TCatchall : never);
73
68
  /**
74
69
  * Type alias for a valid schema object.
75
70
  * Can be a schema object or a schema outer array.
76
71
  *
77
72
  * @template SV - SchemaValidator type.
78
73
  */
79
- export type ValidSchemaObject<SV extends AnySchemaValidator> = SchemaObject<SchemaObjectShape<SV>, SV> | SchemaOuterArray<SchemaObject<SchemaObjectShape<SV>, SV>, SV>;
74
+ export type ValidSchemaObject<SV extends SchemaValidator> = SchemaObject<SchemaObjectShape<SV>, SV> | SchemaOuterArray<SchemaObject<SchemaObjectShape<SV>, SV>, SV>;
80
75
  /**
81
76
  * Type alias for a schema.
82
77
  * Applies prettification to the resolved schema.
@@ -84,5 +79,5 @@ export type ValidSchemaObject<SV extends AnySchemaValidator> = SchemaObject<Sche
84
79
  * @template T - Valid schema object or idiomatic schema.
85
80
  * @template SV - SchemaValidator type.
86
81
  */
87
- export type Schema<T extends ValidSchemaObject<SV> | IdiomaticSchema<SchemaCatchall<SV>>, SV extends AnySchemaValidator> = SchemaPrettify<SchemaResolve<T, SV>, SV>;
82
+ export type Schema<T extends ValidSchemaObject<SV> | IdiomaticSchema<SchemaCatchall<SV>>, SV extends SchemaValidator> = SchemaPrettify<SchemaResolve<T, SV>, SV>;
88
83
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forklaunch/validator",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "Schema validator for ForkLaunch components.",
5
5
  "files": [
6
6
  "dist"