typebox 1.2.8 → 1.2.9
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,4 +1,5 @@
|
|
|
1
1
|
import { type TSchema } from '../../types/schema.mjs';
|
|
2
|
+
import { type TProperties } from '../../types/properties.mjs';
|
|
2
3
|
import { type TUnion } from '../../types/union.mjs';
|
|
3
4
|
import { type TObject } from '../../types/object.mjs';
|
|
4
5
|
import { type TTuple } from '../../types/tuple.mjs';
|
|
@@ -6,7 +7,7 @@ import { type TComposite } from './composite.mjs';
|
|
|
6
7
|
import { type TNarrow } from './narrow.mjs';
|
|
7
8
|
import { type TEvaluateType } from './evaluate.mjs';
|
|
8
9
|
import { type TEvaluateIntersect } from './evaluate.mjs';
|
|
9
|
-
type TIsObjectLike<Type extends TSchema> = Type extends TObject
|
|
10
|
+
type TIsObjectLike<Type extends TSchema> = (Type extends TObject<infer _ extends TProperties> ? true : Type extends TTuple<infer _ extends TSchema[]> ? true : false);
|
|
10
11
|
type TIsUnionOperand<Left extends TSchema, Right extends TSchema, IsUnionLeft extends boolean = Left extends TUnion ? true : false, IsUnionRight extends boolean = Right extends TUnion ? true : false, Result extends boolean = IsUnionLeft extends true ? true : IsUnionRight extends true ? true : false> = Result;
|
|
11
12
|
type TDistributeOperation<Left extends TSchema, Right extends TSchema, EvaluatedLeft extends TSchema = TEvaluateType<Left>, EvaluatedRight extends TSchema = TEvaluateType<Right>, IsUnionOperand extends boolean = TIsUnionOperand<EvaluatedLeft, EvaluatedRight>, IsObjectLeft extends boolean = TIsObjectLike<EvaluatedLeft>, IsObjectRight extends boolean = TIsObjectLike<EvaluatedRight>, Result extends TSchema = ([
|
|
12
13
|
IsUnionOperand
|