@forklaunch/validator 1.1.7 → 1.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.
@@ -1,5 +1,5 @@
1
1
  import { SchemaObject } from 'openapi3-ts/oas31';
2
- import { e as SchemaValidator, L as LiteralSchema, b as ParseResult } from '../../schema.types-DA-RijFU.mjs';
2
+ import { e as SchemaValidator, L as LiteralSchema, b as ParseResult } from '../../schema.types-CwnyfHOA.mjs';
3
3
  import '@forklaunch/common';
4
4
  import '@sinclair/typebox';
5
5
  import '@sinclair/typebox/compiler';
@@ -1,5 +1,5 @@
1
1
  import { SchemaObject } from 'openapi3-ts/oas31';
2
- import { e as SchemaValidator, L as LiteralSchema, b as ParseResult } from '../../schema.types-DA-RijFU.js';
2
+ import { e as SchemaValidator, L as LiteralSchema, b as ParseResult } from '../../schema.types-CwnyfHOA.js';
3
3
  import '@forklaunch/common';
4
4
  import '@sinclair/typebox';
5
5
  import '@sinclair/typebox/compiler';
package/lib/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as ParseError } from './schema.types-DA-RijFU.mjs';
2
- export { A as AnySchemaValidator, I as IdiomaticSchema, a as Increment, K as KeyTypes, L as LiteralSchema, b as ParseResult, S as Schema, c as SchemaResolve, d as SchemaTranslate, e as SchemaValidator, U as UnboxedObjectSchema } from './schema.types-DA-RijFU.mjs';
1
+ import { P as ParseError } from './schema.types-CwnyfHOA.mjs';
2
+ export { A as AnySchemaValidator, I as IdiomaticSchema, a as Increment, K as KeyTypes, L as LiteralSchema, b as ParseResult, S as Schema, c as SchemaResolve, d as SchemaTranslate, e as SchemaValidator, U as UnboxedObjectSchema } from './schema.types-CwnyfHOA.mjs';
3
3
  import '@forklaunch/common';
4
4
  import 'openapi3-ts/oas31';
5
5
  import '@sinclair/typebox';
package/lib/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as ParseError } from './schema.types-DA-RijFU.js';
2
- export { A as AnySchemaValidator, I as IdiomaticSchema, a as Increment, K as KeyTypes, L as LiteralSchema, b as ParseResult, S as Schema, c as SchemaResolve, d as SchemaTranslate, e as SchemaValidator, U as UnboxedObjectSchema } from './schema.types-DA-RijFU.js';
1
+ import { P as ParseError } from './schema.types-CwnyfHOA.js';
2
+ export { A as AnySchemaValidator, I as IdiomaticSchema, a as Increment, K as KeyTypes, L as LiteralSchema, b as ParseResult, S as Schema, c as SchemaResolve, d as SchemaTranslate, e as SchemaValidator, U as UnboxedObjectSchema } from './schema.types-CwnyfHOA.js';
3
3
  import '@forklaunch/common';
4
4
  import 'openapi3-ts/oas31';
5
5
  import '@sinclair/typebox';
@@ -211,7 +211,7 @@ type UnionTupleTResolve<T extends TUnionTupleContainer, Acc extends TIdiomaticSc
211
211
  * @template T - The schema type to resolve.
212
212
  * @template Depth - The current depth of the resolution.
213
213
  */
214
- type TResolve<T, Depth extends number = 0> = Depth extends 12 ? TUnknown : T extends LiteralSchema ? TLiteral<T> : T extends TSchema ? T : T extends TKind ? T : T extends UnboxedTObjectSchema ? SafeTObject<{
214
+ type TResolve<T, Depth extends number = 0> = Depth extends 12 ? TUnknown : T extends TSchema ? T : T extends TKind ? T : T extends LiteralSchema ? TLiteral<T> : T extends UnboxedTObjectSchema ? SafeTObject<{
215
215
  [K in keyof T]: TResolve<T[K], Increment<Depth>>;
216
216
  }> extends infer R ? R : TNever : T extends TypeCheck<infer Type> ? TResolve<Type, Increment<Depth>> : TNever;
217
217
 
@@ -438,9 +438,9 @@ type UnionZodResolve<T extends ZodUnionContainer> = T extends [
438
438
  * @template T - The Zod schema type to resolve.
439
439
  * @template Depth - The current depth of the resolution.
440
440
  */
441
- type ZodResolve<T, Depth extends number = 0> = Depth extends 24 ? ZodUnknown : T extends ZodPipeline<ZodTypeAny, infer R> ? R : T extends ZodEffects<infer R> ? R : T extends LiteralSchema ? ZodLiteral<T> : T extends ZodType ? T : T extends UnboxedZodObjectSchema ? ZodObject<{
441
+ type ZodResolve<T, Depth extends number = 0> = Depth extends 15 ? ZodUnknown : T extends ZodType ? T extends ZodPipeline<ZodTypeAny, infer R> ? R : T extends ZodEffects<infer R> ? R : T : T extends LiteralSchema ? ZodLiteral<T> : T extends UnboxedZodObjectSchema ? ZodObject<{
442
442
  [K in keyof T]: ZodResolve<T[K], Increment<Depth>>;
443
- }> extends infer R ? R : ZodNever : ZodNever;
443
+ }> : ZodNever;
444
444
  /**
445
445
  * Represents the key type of a Zod record schema.
446
446
  *
@@ -746,11 +746,42 @@ type LiteralSchema = string | number | boolean;
746
746
  */
747
747
  type IdiomaticSchema<SV extends AnySchemaValidator> = LiteralSchema | SV['_SchemaCatchall'] | UnboxedObjectSchema<SV>;
748
748
  /**
749
- * Increments a number type by one, with support up to 50.
749
+ * Tuple-based lookup for incrementing a number type by one. O(1) indexed access
750
+ * instead of O(n) conditional chain.
751
+ */
752
+ type IncrementMap = [
753
+ 1,
754
+ 2,
755
+ 3,
756
+ 4,
757
+ 5,
758
+ 6,
759
+ 7,
760
+ 8,
761
+ 9,
762
+ 10,
763
+ 11,
764
+ 12,
765
+ 13,
766
+ 14,
767
+ 15,
768
+ 16,
769
+ 17,
770
+ 18,
771
+ 19,
772
+ 20,
773
+ 21,
774
+ 22,
775
+ 23,
776
+ 24,
777
+ 25
778
+ ];
779
+ /**
780
+ * Increments a number type by one, with support up to 24.
750
781
  *
751
782
  * @template T - The number type to increment.
752
783
  */
753
- type Increment<T extends number> = T extends 0 ? 1 : T extends 1 ? 2 : T extends 2 ? 3 : T extends 3 ? 4 : T extends 4 ? 5 : T extends 5 ? 6 : T extends 6 ? 7 : T extends 7 ? 8 : T extends 8 ? 9 : T extends 9 ? 10 : T extends 10 ? 11 : T extends 11 ? 12 : T extends 12 ? 13 : T extends 13 ? 14 : T extends 14 ? 15 : T extends 15 ? 16 : T extends 16 ? 17 : T extends 17 ? 18 : T extends 18 ? 19 : T extends 19 ? 20 : T extends 20 ? 21 : T extends 21 ? 22 : T extends 22 ? 23 : T extends 23 ? 24 : T extends 24 ? 25 : T extends 25 ? 26 : T extends 26 ? 27 : T extends 27 ? 28 : T extends 28 ? 29 : T extends 29 ? 30 : T extends 30 ? 31 : T extends 31 ? 32 : T extends 32 ? 33 : T extends 33 ? 34 : T extends 34 ? 35 : T extends 35 ? 36 : T extends 36 ? 37 : T extends 37 ? 38 : T extends 38 ? 39 : T extends 39 ? 40 : T extends 40 ? 41 : T extends 41 ? 42 : T extends 42 ? 43 : T extends 43 ? 44 : T extends 44 ? 45 : T extends 45 ? 46 : T extends 46 ? 47 : T extends 47 ? 48 : T extends 48 ? 49 : T extends 49 ? 50 : 50;
784
+ type Increment<T extends number> = T extends keyof IncrementMap ? IncrementMap[T] : 25;
754
785
  /**
755
786
  * Represents key types that can be used in the schema.
756
787
  */
@@ -211,7 +211,7 @@ type UnionTupleTResolve<T extends TUnionTupleContainer, Acc extends TIdiomaticSc
211
211
  * @template T - The schema type to resolve.
212
212
  * @template Depth - The current depth of the resolution.
213
213
  */
214
- type TResolve<T, Depth extends number = 0> = Depth extends 12 ? TUnknown : T extends LiteralSchema ? TLiteral<T> : T extends TSchema ? T : T extends TKind ? T : T extends UnboxedTObjectSchema ? SafeTObject<{
214
+ type TResolve<T, Depth extends number = 0> = Depth extends 12 ? TUnknown : T extends TSchema ? T : T extends TKind ? T : T extends LiteralSchema ? TLiteral<T> : T extends UnboxedTObjectSchema ? SafeTObject<{
215
215
  [K in keyof T]: TResolve<T[K], Increment<Depth>>;
216
216
  }> extends infer R ? R : TNever : T extends TypeCheck<infer Type> ? TResolve<Type, Increment<Depth>> : TNever;
217
217
 
@@ -438,9 +438,9 @@ type UnionZodResolve<T extends ZodUnionContainer> = T extends [
438
438
  * @template T - The Zod schema type to resolve.
439
439
  * @template Depth - The current depth of the resolution.
440
440
  */
441
- type ZodResolve<T, Depth extends number = 0> = Depth extends 24 ? ZodUnknown : T extends ZodPipeline<ZodTypeAny, infer R> ? R : T extends ZodEffects<infer R> ? R : T extends LiteralSchema ? ZodLiteral<T> : T extends ZodType ? T : T extends UnboxedZodObjectSchema ? ZodObject<{
441
+ type ZodResolve<T, Depth extends number = 0> = Depth extends 15 ? ZodUnknown : T extends ZodType ? T extends ZodPipeline<ZodTypeAny, infer R> ? R : T extends ZodEffects<infer R> ? R : T : T extends LiteralSchema ? ZodLiteral<T> : T extends UnboxedZodObjectSchema ? ZodObject<{
442
442
  [K in keyof T]: ZodResolve<T[K], Increment<Depth>>;
443
- }> extends infer R ? R : ZodNever : ZodNever;
443
+ }> : ZodNever;
444
444
  /**
445
445
  * Represents the key type of a Zod record schema.
446
446
  *
@@ -746,11 +746,42 @@ type LiteralSchema = string | number | boolean;
746
746
  */
747
747
  type IdiomaticSchema<SV extends AnySchemaValidator> = LiteralSchema | SV['_SchemaCatchall'] | UnboxedObjectSchema<SV>;
748
748
  /**
749
- * Increments a number type by one, with support up to 50.
749
+ * Tuple-based lookup for incrementing a number type by one. O(1) indexed access
750
+ * instead of O(n) conditional chain.
751
+ */
752
+ type IncrementMap = [
753
+ 1,
754
+ 2,
755
+ 3,
756
+ 4,
757
+ 5,
758
+ 6,
759
+ 7,
760
+ 8,
761
+ 9,
762
+ 10,
763
+ 11,
764
+ 12,
765
+ 13,
766
+ 14,
767
+ 15,
768
+ 16,
769
+ 17,
770
+ 18,
771
+ 19,
772
+ 20,
773
+ 21,
774
+ 22,
775
+ 23,
776
+ 24,
777
+ 25
778
+ ];
779
+ /**
780
+ * Increments a number type by one, with support up to 24.
750
781
  *
751
782
  * @template T - The number type to increment.
752
783
  */
753
- type Increment<T extends number> = T extends 0 ? 1 : T extends 1 ? 2 : T extends 2 ? 3 : T extends 3 ? 4 : T extends 4 ? 5 : T extends 5 ? 6 : T extends 6 ? 7 : T extends 7 ? 8 : T extends 8 ? 9 : T extends 9 ? 10 : T extends 10 ? 11 : T extends 11 ? 12 : T extends 12 ? 13 : T extends 13 ? 14 : T extends 14 ? 15 : T extends 15 ? 16 : T extends 16 ? 17 : T extends 17 ? 18 : T extends 18 ? 19 : T extends 19 ? 20 : T extends 20 ? 21 : T extends 21 ? 22 : T extends 22 ? 23 : T extends 23 ? 24 : T extends 24 ? 25 : T extends 25 ? 26 : T extends 26 ? 27 : T extends 27 ? 28 : T extends 28 ? 29 : T extends 29 ? 30 : T extends 30 ? 31 : T extends 31 ? 32 : T extends 32 ? 33 : T extends 33 ? 34 : T extends 34 ? 35 : T extends 35 ? 36 : T extends 36 ? 37 : T extends 37 ? 38 : T extends 38 ? 39 : T extends 39 ? 40 : T extends 40 ? 41 : T extends 41 ? 42 : T extends 42 ? 43 : T extends 43 ? 44 : T extends 44 ? 45 : T extends 45 ? 46 : T extends 46 ? 47 : T extends 47 ? 48 : T extends 48 ? 49 : T extends 49 ? 50 : 50;
784
+ type Increment<T extends number> = T extends keyof IncrementMap ? IncrementMap[T] : 25;
754
785
  /**
755
786
  * Represents key types that can be used in the schema.
756
787
  */
@@ -1,6 +1,6 @@
1
1
  export * from '@sinclair/typebox';
2
- import { T as TypeboxSchemaValidator } from '../../schema.types-DA-RijFU.mjs';
3
- export { f as SafeTObject, g as TCatchall, h as TIdiomaticSchema, i as TObjectShape, j as TOuterArray, k as TResolve, l as TSchemaTranslate, m as TUnionTupleContainer, n as UnboxedTObjectSchema, o as UnionTupleTResolve } from '../../schema.types-DA-RijFU.mjs';
2
+ import { T as TypeboxSchemaValidator } from '../../schema.types-CwnyfHOA.mjs';
3
+ export { f as SafeTObject, g as TCatchall, h as TIdiomaticSchema, i as TObjectShape, j as TOuterArray, k as TResolve, l as TSchemaTranslate, m as TUnionTupleContainer, n as UnboxedTObjectSchema, o as UnionTupleTResolve } from '../../schema.types-CwnyfHOA.mjs';
4
4
  import '@forklaunch/common';
5
5
  import 'openapi3-ts/oas31';
6
6
  import '@sinclair/typebox/compiler';
@@ -1,6 +1,6 @@
1
1
  export * from '@sinclair/typebox';
2
- import { T as TypeboxSchemaValidator } from '../../schema.types-DA-RijFU.js';
3
- export { f as SafeTObject, g as TCatchall, h as TIdiomaticSchema, i as TObjectShape, j as TOuterArray, k as TResolve, l as TSchemaTranslate, m as TUnionTupleContainer, n as UnboxedTObjectSchema, o as UnionTupleTResolve } from '../../schema.types-DA-RijFU.js';
2
+ import { T as TypeboxSchemaValidator } from '../../schema.types-CwnyfHOA.js';
3
+ export { f as SafeTObject, g as TCatchall, h as TIdiomaticSchema, i as TObjectShape, j as TOuterArray, k as TResolve, l as TSchemaTranslate, m as TUnionTupleContainer, n as UnboxedTObjectSchema, o as UnionTupleTResolve } from '../../schema.types-CwnyfHOA.js';
4
4
  import '@forklaunch/common';
5
5
  import 'openapi3-ts/oas31';
6
6
  import '@sinclair/typebox/compiler';
@@ -1,6 +1,6 @@
1
1
  export { ZodAny, ZodArray, ZodBigInt, ZodBoolean, ZodDate, ZodEffects, ZodEnum, ZodFunction, ZodLiteral, ZodNever, ZodNull, ZodNumber, ZodObject, ZodOptional, ZodPipeline, ZodPromise, ZodRawShape, ZodRecord, ZodString, ZodSymbol, ZodTuple, ZodType, ZodTypeAny, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid } from 'zod/v3';
2
- import { Z as ZodSchemaValidator } from '../../schema.types-DA-RijFU.mjs';
3
- export { p as TupleZodResolve, q as UnboxedZodObjectSchema, r as UnionZodResolve, s as ZodCatchall, t as ZodIdiomaticSchema, u as ZodObjectShape, v as ZodOuterArray, w as ZodRecordKey, x as ZodResolve, y as ZodSchemaTranslate, z as ZodTupleContainer, B as ZodUnionContainer } from '../../schema.types-DA-RijFU.mjs';
2
+ import { Z as ZodSchemaValidator } from '../../schema.types-CwnyfHOA.mjs';
3
+ export { p as TupleZodResolve, q as UnboxedZodObjectSchema, r as UnionZodResolve, s as ZodCatchall, t as ZodIdiomaticSchema, u as ZodObjectShape, v as ZodOuterArray, w as ZodRecordKey, x as ZodResolve, y as ZodSchemaTranslate, z as ZodTupleContainer, B as ZodUnionContainer } from '../../schema.types-CwnyfHOA.mjs';
4
4
  import '@forklaunch/common';
5
5
  import 'openapi3-ts/oas31';
6
6
  import '@sinclair/typebox';
@@ -1,6 +1,6 @@
1
1
  export { ZodAny, ZodArray, ZodBigInt, ZodBoolean, ZodDate, ZodEffects, ZodEnum, ZodFunction, ZodLiteral, ZodNever, ZodNull, ZodNumber, ZodObject, ZodOptional, ZodPipeline, ZodPromise, ZodRawShape, ZodRecord, ZodString, ZodSymbol, ZodTuple, ZodType, ZodTypeAny, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid } from 'zod/v3';
2
- import { Z as ZodSchemaValidator } from '../../schema.types-DA-RijFU.js';
3
- export { p as TupleZodResolve, q as UnboxedZodObjectSchema, r as UnionZodResolve, s as ZodCatchall, t as ZodIdiomaticSchema, u as ZodObjectShape, v as ZodOuterArray, w as ZodRecordKey, x as ZodResolve, y as ZodSchemaTranslate, z as ZodTupleContainer, B as ZodUnionContainer } from '../../schema.types-DA-RijFU.js';
2
+ import { Z as ZodSchemaValidator } from '../../schema.types-CwnyfHOA.js';
3
+ export { p as TupleZodResolve, q as UnboxedZodObjectSchema, r as UnionZodResolve, s as ZodCatchall, t as ZodIdiomaticSchema, u as ZodObjectShape, v as ZodOuterArray, w as ZodRecordKey, x as ZodResolve, y as ZodSchemaTranslate, z as ZodTupleContainer, B as ZodUnionContainer } from '../../schema.types-CwnyfHOA.js';
4
4
  import '@forklaunch/common';
5
5
  import 'openapi3-ts/oas31';
6
6
  import '@sinclair/typebox';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forklaunch/validator",
3
- "version": "1.1.7",
3
+ "version": "1.2.0",
4
4
  "description": "Schema validator for ForkLaunch components.",
5
5
  "homepage": "https://github.com/forklaunch/forklaunch-js#readme",
6
6
  "bugs": {
@@ -61,13 +61,13 @@
61
61
  "@sinclair/typebox": "^0.34.48",
62
62
  "ts-deepmerge": "^7.0.3",
63
63
  "zod": "^4.3.6",
64
- "@forklaunch/common": "1.1.7"
64
+ "@forklaunch/common": "1.2.0"
65
65
  },
66
66
  "devDependencies": {
67
67
  "@eslint/js": "^10.0.1",
68
68
  "@types/jest": "^30.0.0",
69
69
  "@types/node": "^25.5.0",
70
- "@typescript/native-preview": "7.0.0-dev.20260325.1",
70
+ "@typescript/native-preview": "7.0.0-dev.20260320.1",
71
71
  "@vitest/coverage-v8": "^4.1.1",
72
72
  "eslint-config-prettier": "^10.1.8",
73
73
  "eslint-plugin-prettier": "^5.5.5",