typebox 1.0.77 → 1.0.78

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.
@@ -3,6 +3,13 @@ import type { XStaticSchema } from './schema.mjs';
3
3
  import type { XIf } from '../types/if.mjs';
4
4
  import type { XElse } from '../types/else.mjs';
5
5
  import type { XThen } from '../types/then.mjs';
6
- type XStaticIfReduce<Types extends unknown[], Result extends unknown = never> = (Types extends [infer Left extends unknown, ...infer Right extends unknown[]] ? XStaticIfReduce<Right, Result | Left> : Result);
7
- export type XStaticIf<Stack extends string[], Root extends XSchema, Schema extends XIf, IfSchema extends XSchema, Then extends unknown[] = Schema extends XThen<infer ThenSchema extends XSchema> ? [XStaticSchema<Stack, Root, IfSchema> & XStaticSchema<Stack, Root, ThenSchema>] : [], Else extends unknown[] = Schema extends XElse<infer ElseSchema extends XSchema> ? [...Then, XStaticSchema<Stack, Root, ElseSchema>] : Then, Result extends unknown = Else extends [] ? unknown : XStaticIfReduce<Else>> = Result;
8
- export {};
6
+ export type XStaticIf<Stack extends string[], Root extends XSchema, Schema extends XIf, IfSchema extends XSchema, If extends unknown = XStaticSchema<Stack, Root, IfSchema>, Then extends unknown = Schema extends XThen<infer ThenSchema extends XSchema> ? XStaticSchema<Stack, Root, ThenSchema> : never, Else extends unknown = Schema extends XElse<infer ElseSchema extends XSchema> ? XStaticSchema<Stack, Root, ElseSchema> : never, IsThen extends boolean = Schema extends XThen ? true : false, IsElse extends boolean = Schema extends XElse ? true : false, Result extends unknown = ([
7
+ IsThen,
8
+ IsElse
9
+ ] extends [true, true] ? (If & Then) | Exclude<Else, If> : [
10
+ IsThen,
11
+ IsElse
12
+ ] extends [true, false] ? (If & Then) : [
13
+ IsThen,
14
+ IsElse
15
+ ] extends [false, true] ? Exclude<Else, If> : unknown)> = Result;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "typebox",
3
3
  "description": "Json Schema Type Builder with Static Type Resolution for TypeScript",
4
- "version": "1.0.77",
4
+ "version": "1.0.78",
5
5
  "keywords": [
6
6
  "typescript",
7
7
  "jsonschema"