@sinclair/typebox 0.32.0-dev-15 → 0.32.0-dev-16
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/build/import/index.d.mts +2 -2
- package/build/import/index.mjs +2 -2
- package/build/import/type/array/array.d.mts +1 -1
- package/build/import/type/constructor/constructor.d.mts +4 -4
- package/build/import/type/exclude/exclude.d.mts +3 -3
- package/build/import/type/extends/extends.mjs +1 -1
- package/build/import/type/extract/extract.d.mts +3 -3
- package/build/import/type/function/function.d.mts +4 -4
- package/build/import/type/indexed/indexed-result.d.mts +6 -6
- package/build/import/type/indexed/indexed-result.mjs +7 -7
- package/build/import/type/indexed/indexed.mjs +1 -1
- package/build/import/type/intersect/index.d.mts +2 -0
- package/build/import/type/intersect/index.mjs +2 -0
- package/build/import/type/intersect/intersect-create.d.mts +3 -0
- package/build/import/type/intersect/intersect-create.mjs +12 -0
- package/build/import/type/intersect/intersect-evaluated.d.mts +16 -0
- package/build/import/type/intersect/intersect-evaluated.mjs +35 -0
- package/build/import/type/intersect/intersect-type.d.mts +15 -0
- package/build/import/type/intersect/intersect-type.mjs +1 -0
- package/build/import/type/intersect/intersect.d.mts +4 -20
- package/build/import/type/intersect/intersect.mjs +5 -17
- package/build/import/type/keyof/keyof.d.mts +2 -2
- package/build/import/type/keyof/keyof.mjs +2 -2
- package/build/import/type/mapped/mapped.mjs +1 -2
- package/build/import/type/object/object.d.mts +5 -5
- package/build/import/type/record/record.d.mts +0 -1
- package/build/import/type/record/record.mjs +1 -1
- package/build/import/type/recursive/recursive.d.mts +3 -2
- package/build/import/type/recursive/recursive.mjs +1 -5
- package/build/import/type/template-literal/syntax.d.mts +4 -4
- package/build/import/type/template-literal/template-literal.d.mts +4 -4
- package/build/import/type/transform/transform.d.mts +3 -2
- package/build/import/type/transform/transform.mjs +1 -1
- package/build/import/type/tuple/tuple.d.mts +3 -3
- package/build/import/type/type/json.d.mts +4 -4
- package/build/import/type/union/index.d.mts +2 -0
- package/build/import/type/union/index.mjs +2 -0
- package/build/import/type/union/union-create.d.mts +3 -0
- package/build/import/type/union/union-create.mjs +5 -0
- package/build/import/type/union/union-evaluated.d.mts +16 -0
- package/build/import/type/union/union-evaluated.mjs +31 -0
- package/build/import/type/union/union-type.d.mts +12 -0
- package/build/import/type/union/union-type.mjs +1 -0
- package/build/import/type/union/union.d.mts +3 -13
- package/build/import/type/union/union.mjs +3 -10
- package/build/import/value/delta/delta.d.mts +1 -1
- package/build/require/index.d.ts +2 -2
- package/build/require/index.js +5 -2
- package/build/require/type/array/array.d.ts +1 -1
- package/build/require/type/constructor/constructor.d.ts +4 -4
- package/build/require/type/exclude/exclude.d.ts +3 -3
- package/build/require/type/extends/extends.js +5 -5
- package/build/require/type/extract/extract.d.ts +3 -3
- package/build/require/type/function/function.d.ts +4 -4
- package/build/require/type/indexed/indexed-result.d.ts +6 -6
- package/build/require/type/indexed/indexed-result.js +4 -4
- package/build/require/type/indexed/indexed.js +4 -4
- package/build/require/type/intersect/index.d.ts +2 -0
- package/build/require/type/intersect/index.js +2 -0
- package/build/require/type/intersect/intersect-create.d.ts +3 -0
- package/build/require/type/intersect/intersect-create.js +16 -0
- package/build/require/type/intersect/intersect-evaluated.d.ts +16 -0
- package/build/require/type/intersect/intersect-evaluated.js +39 -0
- package/build/require/type/intersect/intersect-type.d.ts +15 -0
- package/build/require/type/intersect/intersect-type.js +3 -0
- package/build/require/type/intersect/intersect.d.ts +4 -20
- package/build/require/type/intersect/intersect.js +5 -18
- package/build/require/type/keyof/keyof.d.ts +2 -2
- package/build/require/type/keyof/keyof.js +1 -1
- package/build/require/type/mapped/mapped.js +18 -19
- package/build/require/type/object/object.d.ts +5 -5
- package/build/require/type/record/record.d.ts +0 -1
- package/build/require/type/record/record.js +1 -2
- package/build/require/type/recursive/recursive.d.ts +3 -2
- package/build/require/type/recursive/recursive.js +1 -5
- package/build/require/type/template-literal/syntax.d.ts +4 -4
- package/build/require/type/template-literal/template-literal.d.ts +4 -4
- package/build/require/type/transform/transform.d.ts +3 -2
- package/build/require/type/transform/transform.js +4 -4
- package/build/require/type/tuple/tuple.d.ts +3 -3
- package/build/require/type/type/json.d.ts +4 -4
- package/build/require/type/union/index.d.ts +2 -0
- package/build/require/type/union/index.js +2 -0
- package/build/require/type/union/union-create.d.ts +3 -0
- package/build/require/type/union/union-create.js +9 -0
- package/build/require/type/union/union-evaluated.d.ts +16 -0
- package/build/require/type/union/union-evaluated.js +35 -0
- package/build/require/type/union/union-type.d.ts +12 -0
- package/build/require/type/union/union-type.js +3 -0
- package/build/require/type/union/union.d.ts +3 -13
- package/build/require/type/union/union.js +3 -11
- package/build/require/value/delta/delta.d.ts +1 -1
- package/package.json +1 -1
- package/readme.md +27 -19
|
@@ -1,30 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Intersect =
|
|
4
|
-
const index_1 = require("../never/index");
|
|
5
|
-
const index_2 = require("../modifiers/index");
|
|
6
|
-
const index_3 = require("../symbols/index");
|
|
3
|
+
exports.Intersect = void 0;
|
|
7
4
|
const type_1 = require("../clone/type");
|
|
5
|
+
const index_1 = require("../never/index");
|
|
6
|
+
const intersect_create_1 = require("./intersect-create");
|
|
8
7
|
const type_2 = require("../guard/type");
|
|
9
|
-
function IntersectResolve(T) {
|
|
10
|
-
return (T.length === 0
|
|
11
|
-
? (0, index_1.Never)()
|
|
12
|
-
: T.length === 1
|
|
13
|
-
? T[0]
|
|
14
|
-
: (0, index_2.OptionalFromIntersect)(T));
|
|
15
|
-
}
|
|
16
|
-
exports.IntersectResolve = IntersectResolve;
|
|
17
8
|
function Intersect(T, options = {}) {
|
|
18
9
|
if (T.length === 0)
|
|
19
|
-
return (0, index_1.Never)();
|
|
10
|
+
return (0, index_1.Never)(options);
|
|
20
11
|
if (T.length === 1)
|
|
21
12
|
return (0, type_1.CloneType)(T[0], options);
|
|
22
13
|
if (T.some((schema) => (0, type_2.TTransform)(schema)))
|
|
23
14
|
throw new Error('Cannot intersect transform types');
|
|
24
|
-
|
|
25
|
-
const clonedUnevaluatedProperties = (0, type_2.TSchema)(options.unevaluatedProperties) ? { unevaluatedProperties: (0, type_1.CloneType)(options.unevaluatedProperties) } : {};
|
|
26
|
-
return (options.unevaluatedProperties === false || (0, type_2.TSchema)(options.unevaluatedProperties) || allObjects
|
|
27
|
-
? { ...options, ...clonedUnevaluatedProperties, [index_3.Kind]: 'Intersect', type: 'object', allOf: (0, type_1.CloneRest)(T) }
|
|
28
|
-
: { ...options, ...clonedUnevaluatedProperties, [index_3.Kind]: 'Intersect', allOf: (0, type_1.CloneRest)(T) });
|
|
15
|
+
return (0, intersect_create_1.IntersectCreate)(T, options);
|
|
29
16
|
}
|
|
30
17
|
exports.Intersect = Intersect;
|
|
@@ -5,11 +5,11 @@ import { type TLiteral, TLiteralValue } from '../literal/index';
|
|
|
5
5
|
import { type TNumber } from '../number/index';
|
|
6
6
|
import { type SchemaOptions } from '../schema/index';
|
|
7
7
|
import { KeyOfPropertyKeys } from './keyof-property-keys';
|
|
8
|
-
import {
|
|
8
|
+
import { UnionEvaluated } from '../union/index';
|
|
9
9
|
import { type TKeyOfFromMappedResult } from './keyof-from-mapped-result';
|
|
10
10
|
type FromLiterals<T extends TLiteralValue[]> = (T extends [infer L extends TLiteralValue, ...infer R extends TLiteralValue[]] ? L extends '[number]' ? [TNumber, ...FromLiterals<R>] : [TLiteral<L>, ...FromLiterals<R>] : []);
|
|
11
11
|
declare function FromLiterals<T extends TLiteralValue[]>(T: [...T]): FromLiterals<T>;
|
|
12
|
-
export type TKeyOf<T extends TSchema> = (Ensure<
|
|
12
|
+
export type TKeyOf<T extends TSchema> = (Ensure<UnionEvaluated<FromLiterals<KeyOfPropertyKeys<T>>>>);
|
|
13
13
|
export declare function KeyOf<T extends TMappedResult>(T: T, options?: SchemaOptions): TKeyOfFromMappedResult<T>;
|
|
14
14
|
export declare function KeyOf<T extends TSchema>(T: T, options?: SchemaOptions): TKeyOf<T>;
|
|
15
15
|
export {};
|
|
@@ -21,7 +21,7 @@ function KeyOf(T, options = {}) {
|
|
|
21
21
|
return (0, keyof_from_mapped_result_1.KeyOfFromMappedResult)(T, options);
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
24
|
-
const K = (0, index_3.
|
|
24
|
+
const K = (0, index_3.UnionEvaluated)(FromLiterals((0, keyof_property_keys_1.KeyOfPropertyKeys)(T)));
|
|
25
25
|
return (0, type_1.CloneType)(K, options);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Mapped = void 0;
|
|
4
|
-
const type_1 = require("../guard/type");
|
|
5
4
|
const index_1 = require("../symbols/index");
|
|
6
|
-
const
|
|
5
|
+
const type_1 = require("../clone/type");
|
|
7
6
|
const index_2 = require("../discard/index");
|
|
8
7
|
const index_3 = require("../array/index");
|
|
9
8
|
const index_4 = require("../async-iterator/index");
|
|
@@ -20,7 +19,7 @@ const index_14 = require("../readonly/index");
|
|
|
20
19
|
const index_15 = require("../tuple/index");
|
|
21
20
|
const index_16 = require("../union/index");
|
|
22
21
|
const mapped_result_1 = require("./mapped-result");
|
|
23
|
-
const
|
|
22
|
+
const type_2 = require("../guard/type");
|
|
24
23
|
function FromMappedResult(K, P) {
|
|
25
24
|
return (K in P
|
|
26
25
|
? FromSchemaType(K, P[K])
|
|
@@ -48,20 +47,20 @@ function FromProperties(K, T) {
|
|
|
48
47
|
}, {});
|
|
49
48
|
}
|
|
50
49
|
function FromSchemaType(K, T) {
|
|
51
|
-
return ((0,
|
|
52
|
-
(0,
|
|
53
|
-
(0,
|
|
54
|
-
(0,
|
|
55
|
-
(0,
|
|
56
|
-
(0,
|
|
57
|
-
(0,
|
|
58
|
-
(0,
|
|
59
|
-
(0,
|
|
60
|
-
(0,
|
|
61
|
-
(0,
|
|
62
|
-
(0,
|
|
63
|
-
(0,
|
|
64
|
-
(0,
|
|
50
|
+
return ((0, type_2.TOptional)(T) ? (0, index_12.Optional)(FromSchemaType(K, (0, index_2.Discard)(T, [index_1.OptionalKind]))) :
|
|
51
|
+
(0, type_2.TReadonly)(T) ? (0, index_14.Readonly)(FromSchemaType(K, (0, index_2.Discard)(T, [index_1.ReadonlyKind]))) :
|
|
52
|
+
(0, type_2.TMappedResult)(T) ? FromMappedResult(K, T.properties) :
|
|
53
|
+
(0, type_2.TMappedKey)(T) ? FromMappedKey(K, T.keys) :
|
|
54
|
+
(0, type_2.TConstructor)(T) ? (0, index_5.Constructor)(FromRest(K, T.parameters), FromSchemaType(K, T.returns)) :
|
|
55
|
+
(0, type_2.TFunction)(T) ? (0, index_6.Function)(FromRest(K, T.parameters), FromSchemaType(K, T.returns)) :
|
|
56
|
+
(0, type_2.TAsyncIterator)(T) ? (0, index_4.AsyncIterator)(FromSchemaType(K, T.items)) :
|
|
57
|
+
(0, type_2.TIterator)(T) ? (0, index_9.Iterator)(FromSchemaType(K, T.items)) :
|
|
58
|
+
(0, type_2.TIntersect)(T) ? (0, index_8.Intersect)(FromRest(K, T.allOf)) :
|
|
59
|
+
(0, type_2.TUnion)(T) ? (0, index_16.Union)(FromRest(K, T.anyOf)) :
|
|
60
|
+
(0, type_2.TTuple)(T) ? (0, index_15.Tuple)(FromRest(K, T.items ?? [])) :
|
|
61
|
+
(0, type_2.TObject)(T) ? (0, index_11.Object)(FromProperties(K, T.properties)) :
|
|
62
|
+
(0, type_2.TArray)(T) ? (0, index_3.Array)(FromSchemaType(K, T.items)) :
|
|
63
|
+
(0, type_2.TPromise)(T) ? (0, index_13.Promise)(FromSchemaType(K, T.item)) :
|
|
65
64
|
T);
|
|
66
65
|
}
|
|
67
66
|
function FromMappedFunctionReturnType(K, T) {
|
|
@@ -71,9 +70,9 @@ function FromMappedFunctionReturnType(K, T) {
|
|
|
71
70
|
: {});
|
|
72
71
|
}
|
|
73
72
|
function Mapped(key, map, options = {}) {
|
|
74
|
-
const K = (0,
|
|
73
|
+
const K = (0, type_2.TSchema)(key) ? (0, index_7.IndexPropertyKeys)(key) : key;
|
|
75
74
|
const RT = map({ [index_1.Kind]: 'MappedKey', keys: K });
|
|
76
75
|
const R = FromMappedFunctionReturnType(K, RT);
|
|
77
|
-
return (0,
|
|
76
|
+
return (0, type_1.CloneType)((0, index_11.Object)(R), options);
|
|
78
77
|
}
|
|
79
78
|
exports.Mapped = Mapped;
|
|
@@ -4,8 +4,6 @@ import type { Evaluate } from '../helpers/index';
|
|
|
4
4
|
import type { TReadonly } from '../readonly/index';
|
|
5
5
|
import type { TOptional } from '../optional/index';
|
|
6
6
|
import { Kind } from '../symbols/index';
|
|
7
|
-
export type TPropertyKey = string | number;
|
|
8
|
-
export type TProperties = Record<TPropertyKey, TSchema>;
|
|
9
7
|
type ReadonlyOptionalPropertyKeys<T extends TProperties> = {
|
|
10
8
|
[K in keyof T]: T[K] extends TReadonly<TSchema> ? (T[K] extends TOptional<T[K]> ? K : never) : never;
|
|
11
9
|
}[keyof T];
|
|
@@ -16,10 +14,12 @@ type OptionalPropertyKeys<T extends TProperties> = {
|
|
|
16
14
|
[K in keyof T]: T[K] extends TOptional<TSchema> ? (T[K] extends TReadonly<T[K]> ? never : K) : never;
|
|
17
15
|
}[keyof T];
|
|
18
16
|
type RequiredPropertyKeys<T extends TProperties> = keyof Omit<T, ReadonlyOptionalPropertyKeys<T> | ReadonlyPropertyKeys<T> | OptionalPropertyKeys<T>>;
|
|
19
|
-
type
|
|
20
|
-
export type
|
|
17
|
+
type ObjectStaticProperties<T extends TProperties, R extends Record<keyof any, unknown>> = Evaluate<(Readonly<Partial<Pick<R, ReadonlyOptionalPropertyKeys<T>>>> & Readonly<Pick<R, ReadonlyPropertyKeys<T>>> & Partial<Pick<R, OptionalPropertyKeys<T>>> & Required<Pick<R, RequiredPropertyKeys<T>>>)>;
|
|
18
|
+
export type ObjectStatic<T extends TProperties, P extends unknown[]> = ObjectStaticProperties<T, {
|
|
21
19
|
[K in keyof T]: Static<T[K], P>;
|
|
22
20
|
}>;
|
|
21
|
+
export type TPropertyKey = string | number;
|
|
22
|
+
export type TProperties = Record<TPropertyKey, TSchema>;
|
|
23
23
|
export type TAdditionalProperties = undefined | TSchema | boolean;
|
|
24
24
|
export interface ObjectOptions extends SchemaOptions {
|
|
25
25
|
additionalProperties?: TAdditionalProperties;
|
|
@@ -28,7 +28,7 @@ export interface ObjectOptions extends SchemaOptions {
|
|
|
28
28
|
}
|
|
29
29
|
export interface TObject<T extends TProperties = TProperties> extends TSchema, ObjectOptions {
|
|
30
30
|
[Kind]: 'Object';
|
|
31
|
-
static:
|
|
31
|
+
static: ObjectStatic<T, this['params']>;
|
|
32
32
|
additionalProperties?: TAdditionalProperties;
|
|
33
33
|
type: 'object';
|
|
34
34
|
properties: T;
|
|
@@ -40,7 +40,6 @@ declare function FromIntegerKey<K extends TInteger, T extends TSchema>(_: K, T:
|
|
|
40
40
|
type FromNumberKey<_ extends TSchema, T extends TSchema> = (Ensure<TRecord<TNumber, T>>);
|
|
41
41
|
declare function FromNumberKey<K extends TNumber, T extends TSchema>(_: K, T: T): FromIntegerKey<K, T>;
|
|
42
42
|
export type RecordResolve<K extends TSchema, T extends TSchema> = K extends TEnum<infer S> ? FromEnumKey<S, T> : K extends TUnion<infer S> ? FromUnionKey<S, T> : K extends TTemplateLiteral ? FromTemplateLiteralKey<K, T> : K extends TLiteral<infer S> ? FromLiteralKey<S, T> : K extends TInteger ? FromIntegerKey<K, T> : K extends TNumber ? FromNumberKey<K, T> : K extends TString ? FromStringKey<K, T> : TNever;
|
|
43
|
-
export declare function RecordResolve<K extends TSchema, T extends TSchema>(K: K, T: T): RecordResolve<K, T>;
|
|
44
43
|
export interface TRecord<K extends TSchema = TSchema, T extends TSchema = TSchema> extends TSchema {
|
|
45
44
|
[Kind]: 'Record';
|
|
46
45
|
static: Record<Assert<Static<K>, string | number>, Static<T, this['params']>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Record =
|
|
3
|
+
exports.Record = void 0;
|
|
4
4
|
const index_1 = require("../object/index");
|
|
5
5
|
const index_2 = require("../never/index");
|
|
6
6
|
const index_3 = require("../union/index");
|
|
@@ -49,7 +49,6 @@ function RecordResolve(K, T) {
|
|
|
49
49
|
(0, type_2.TNumber)(K) ? FromNumberKey(K, T) :
|
|
50
50
|
(0, index_2.Never)());
|
|
51
51
|
}
|
|
52
|
-
exports.RecordResolve = RecordResolve;
|
|
53
52
|
function Record(K, T, options = {}) {
|
|
54
53
|
return (0, type_1.CloneType)(RecordResolve(K, T), options);
|
|
55
54
|
}
|
|
@@ -6,9 +6,10 @@ export interface TThis extends TSchema {
|
|
|
6
6
|
static: this['params'][0];
|
|
7
7
|
$ref: string;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
type RecursiveStatic<T extends TSchema> = Static<T, [RecursiveStatic<T>]>;
|
|
10
10
|
export interface TRecursive<T extends TSchema> extends TSchema {
|
|
11
11
|
[Hint]: 'Recursive';
|
|
12
|
-
static:
|
|
12
|
+
static: RecursiveStatic<T>;
|
|
13
13
|
}
|
|
14
14
|
export declare function Recursive<T extends TSchema>(callback: (thisType: TThis) => T, options?: SchemaOptions): TRecursive<T>;
|
|
15
|
+
export {};
|
|
@@ -10,10 +10,6 @@ function Recursive(callback, options = {}) {
|
|
|
10
10
|
options.$id = `T${Ordinal++}`;
|
|
11
11
|
const thisType = callback({ [index_1.Kind]: 'This', $ref: `${options.$id}` });
|
|
12
12
|
thisType.$id = options.$id;
|
|
13
|
-
return (0, type_1.CloneType)({
|
|
14
|
-
...options,
|
|
15
|
-
[index_1.Hint]: 'Recursive',
|
|
16
|
-
...thisType,
|
|
17
|
-
});
|
|
13
|
+
return (0, type_1.CloneType)({ ...options, [index_1.Hint]: 'Recursive', ...thisType });
|
|
18
14
|
}
|
|
19
15
|
exports.Recursive = Recursive;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Assert, Trim } from '../helpers/index';
|
|
2
2
|
import type { TTemplateLiteralKind, TTemplateLiteral } from './index';
|
|
3
3
|
import { type TLiteral } from '../literal/index';
|
|
4
4
|
import { type TBoolean } from '../boolean/index';
|
|
5
5
|
import { type TBigInt } from '../bigint/index';
|
|
6
6
|
import { type TNumber } from '../number/index';
|
|
7
7
|
import { type TString } from '../string/index';
|
|
8
|
-
import {
|
|
8
|
+
import { UnionEvaluated } from '../union/index';
|
|
9
9
|
declare function FromUnion(syntax: string): IterableIterator<TTemplateLiteralKind>;
|
|
10
10
|
declare function FromTerminal(syntax: string): IterableIterator<TTemplateLiteralKind>;
|
|
11
11
|
type FromUnionLiteral<T extends string> = T extends `${infer L}|${infer R}` ? [TLiteral<Trim<L>>, ...FromUnionLiteral<R>] : T extends `${infer L}` ? [TLiteral<Trim<L>>] : [
|
|
12
12
|
];
|
|
13
|
-
type FromUnion<T extends string> =
|
|
13
|
+
type FromUnion<T extends string> = UnionEvaluated<FromUnionLiteral<T>>;
|
|
14
14
|
type FromTerminal<T extends string> = T extends 'boolean' ? TBoolean : T extends 'bigint' ? TBigInt : T extends 'number' ? TNumber : T extends 'string' ? TString : FromUnion<T>;
|
|
15
15
|
type FromString<T extends string> = T extends `{${infer L}}${infer R}` ? [FromTerminal<L>, ...FromString<R>] : T extends `${infer L}$${infer R}` ? [TLiteral<L>, ...FromString<R>] : T extends `${infer L}` ? [TLiteral<L>] : [
|
|
16
16
|
];
|
|
17
|
-
export type TemplateLiteralSyntax<T extends string> =
|
|
17
|
+
export type TemplateLiteralSyntax<T extends string> = (TTemplateLiteral<Assert<FromString<T>, TTemplateLiteralKind[]>>);
|
|
18
18
|
export declare function TemplateLiteralSyntax(syntax: string): TTemplateLiteralKind[];
|
|
19
19
|
export {};
|
|
@@ -12,14 +12,14 @@ import type { Static } from '../static/index';
|
|
|
12
12
|
import { TemplateLiteralSyntax } from './syntax';
|
|
13
13
|
import { EmptyString } from '../helpers/index';
|
|
14
14
|
import { Kind } from '../symbols/index';
|
|
15
|
-
type
|
|
16
|
-
[K in keyof U]:
|
|
15
|
+
type TemplateLiteralStaticKind<T, Acc extends string> = T extends TUnion<infer U> ? {
|
|
16
|
+
[K in keyof U]: TemplateLiteralStatic<Assert<[U[K]], TTemplateLiteralKind[]>, Acc>;
|
|
17
17
|
}[number] : T extends TTemplateLiteral ? `${Static<T>}` : T extends TLiteral<infer U> ? `${U}` : T extends TString ? `${string}` : T extends TNumber ? `${number}` : T extends TBigInt ? `${bigint}` : T extends TBoolean ? `${boolean}` : never;
|
|
18
|
-
|
|
18
|
+
type TemplateLiteralStatic<T extends TTemplateLiteralKind[], Acc extends string> = T extends [infer L, ...infer R] ? `${TemplateLiteralStaticKind<L, Acc>}${TemplateLiteralStatic<Assert<R, TTemplateLiteralKind[]>, Acc>}` : Acc;
|
|
19
19
|
export type TTemplateLiteralKind = TTemplateLiteral | TUnion | TLiteral | TInteger | TNumber | TBigInt | TString | TBoolean | TNever;
|
|
20
20
|
export interface TTemplateLiteral<T extends TTemplateLiteralKind[] = TTemplateLiteralKind[]> extends TSchema {
|
|
21
21
|
[Kind]: 'TemplateLiteral';
|
|
22
|
-
static:
|
|
22
|
+
static: TemplateLiteralStatic<T, EmptyString>;
|
|
23
23
|
type: 'string';
|
|
24
24
|
pattern: string;
|
|
25
25
|
}
|
|
@@ -14,15 +14,16 @@ export declare class TransformEncodeBuilder<T extends TSchema, D extends Transfo
|
|
|
14
14
|
private EncodeSchema;
|
|
15
15
|
Encode<E extends TransformFunction<ReturnType<D>, StaticDecode<T>>>(encode: E): TTransform<T, ReturnType<D>>;
|
|
16
16
|
}
|
|
17
|
+
type TransformStatic<T extends TSchema, P extends unknown[] = []> = T extends TTransform<infer _, infer S> ? S : Static<T, P>;
|
|
17
18
|
export type TransformFunction<T = any, U = any> = (value: T) => U;
|
|
18
19
|
export interface TransformOptions<I extends TSchema = TSchema, O extends unknown = unknown> {
|
|
19
20
|
Decode: TransformFunction<StaticDecode<I>, O>;
|
|
20
21
|
Encode: TransformFunction<O, StaticDecode<I>>;
|
|
21
22
|
}
|
|
22
|
-
export type TTransformResolve<T extends TSchema, P extends unknown[] = []> = T extends TTransform<infer _, infer S> ? S : Static<T, P>;
|
|
23
23
|
export interface TTransform<I extends TSchema = TSchema, O extends unknown = unknown> extends TSchema {
|
|
24
|
-
static:
|
|
24
|
+
static: TransformStatic<I, this['params']>;
|
|
25
25
|
[TransformKind]: TransformOptions<I, O>;
|
|
26
26
|
[key: string]: any;
|
|
27
27
|
}
|
|
28
28
|
export declare function Transform<I extends TSchema>(schema: I): TransformDecodeBuilder<I>;
|
|
29
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Transform = exports.TransformEncodeBuilder = exports.TransformDecodeBuilder = void 0;
|
|
4
|
-
const type_1 = require("../
|
|
5
|
-
const type_2 = require("../clone/type");
|
|
4
|
+
const type_1 = require("../clone/type");
|
|
6
5
|
const index_1 = require("../symbols/index");
|
|
6
|
+
const type_2 = require("../guard/type");
|
|
7
7
|
class TransformDecodeBuilder {
|
|
8
8
|
constructor(schema) {
|
|
9
9
|
this.schema = schema;
|
|
@@ -29,8 +29,8 @@ class TransformEncodeBuilder {
|
|
|
29
29
|
return { ...schema, [index_1.TransformKind]: Codec };
|
|
30
30
|
}
|
|
31
31
|
Encode(encode) {
|
|
32
|
-
const schema = (0,
|
|
33
|
-
return ((0,
|
|
32
|
+
const schema = (0, type_1.CloneType)(this.schema);
|
|
33
|
+
return ((0, type_2.TTransform)(schema) ? this.EncodeTransform(encode, schema) : this.EncodeSchema(encode, schema));
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
exports.TransformEncodeBuilder = TransformEncodeBuilder;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { TSchema, SchemaOptions } from '../schema/index';
|
|
2
2
|
import type { Static } from '../static/index';
|
|
3
3
|
import { Kind } from '../symbols/index';
|
|
4
|
-
type
|
|
5
|
-
type
|
|
4
|
+
type TupleStaticRest<T extends TSchema[], P extends unknown[]> = T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? [Static<L, P>, ...TupleStaticRest<R, P>] : [];
|
|
5
|
+
type TupleStatic<T extends TSchema[], P extends unknown[], R extends unknown[] = TupleStaticRest<T, P>> = R;
|
|
6
6
|
export interface TTuple<T extends TSchema[] = TSchema[]> extends TSchema {
|
|
7
7
|
[Kind]: 'Tuple';
|
|
8
|
-
static:
|
|
8
|
+
static: TupleStatic<T, this['params']>;
|
|
9
9
|
type: 'array';
|
|
10
10
|
items?: T;
|
|
11
11
|
additionalItems?: false;
|
|
@@ -10,7 +10,7 @@ import { type TExtends, type TExtendsFromMappedKey, type TExtendsFromMappedResul
|
|
|
10
10
|
import { type TExtract, type TExtractFromMappedResult } from '../extract/index';
|
|
11
11
|
import { TIndex, type TIndexPropertyKeys, type TIndexFromMappedKey } from '../indexed/index';
|
|
12
12
|
import { type IntegerOptions, type TInteger } from '../integer/index';
|
|
13
|
-
import {
|
|
13
|
+
import { Intersect, type IntersectOptions } from '../intersect/index';
|
|
14
14
|
import { type TCapitalize, type TUncapitalize, type TLowercase, type TUppercase } from '../intrinsic/index';
|
|
15
15
|
import { type TKeyOf, type TKeyOfFromMappedResult } from '../keyof/index';
|
|
16
16
|
import { type TLiteral, type TLiteralValue } from '../literal/index';
|
|
@@ -37,7 +37,7 @@ import { type TString, type StringOptions } from '../string/index';
|
|
|
37
37
|
import { type TTemplateLiteral, type TTemplateLiteralKind, type TemplateLiteralSyntax } from '../template-literal/index';
|
|
38
38
|
import { TransformDecodeBuilder } from '../transform/index';
|
|
39
39
|
import { type TTuple } from '../tuple/index';
|
|
40
|
-
import {
|
|
40
|
+
import { Union } from '../union/index';
|
|
41
41
|
import { type TUnknown } from '../unknown/index';
|
|
42
42
|
import { type TUnsafe, type UnsafeOptions } from '../unsafe/index';
|
|
43
43
|
export declare class JsonTypeBuilder {
|
|
@@ -64,7 +64,7 @@ export declare class JsonTypeBuilder {
|
|
|
64
64
|
Index<T extends TSchema, K extends TSchema, I extends PropertyKey[] = TIndexPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TIndex<T, I>;
|
|
65
65
|
Index<T extends TSchema, K extends PropertyKey[]>(T: T, K: readonly [...K], options?: SchemaOptions): TIndex<T, K>;
|
|
66
66
|
Integer(options?: IntegerOptions): TInteger;
|
|
67
|
-
Intersect<T extends TSchema[]>(T: [...T], options?: IntersectOptions):
|
|
67
|
+
Intersect<T extends TSchema[]>(T: [...T], options?: IntersectOptions): Intersect<T>;
|
|
68
68
|
KeyOf<T extends TMappedResult>(schema: T, options?: SchemaOptions): TKeyOfFromMappedResult<T>;
|
|
69
69
|
KeyOf<T extends TSchema>(schema: T, options?: SchemaOptions): TKeyOf<T>;
|
|
70
70
|
Literal<T extends TLiteralValue>(value: T, options?: SchemaOptions): TLiteral<T>;
|
|
@@ -97,7 +97,7 @@ export declare class JsonTypeBuilder {
|
|
|
97
97
|
Transform<I extends TSchema>(schema: I): TransformDecodeBuilder<I>;
|
|
98
98
|
Tuple<T extends TSchema[]>(items: [...T], options?: SchemaOptions): TTuple<T>;
|
|
99
99
|
Uncapitalize<T extends TSchema>(schema: T, options?: SchemaOptions): TUncapitalize<T>;
|
|
100
|
-
Union<T extends TSchema[]>(schemas: [...T], options?: SchemaOptions):
|
|
100
|
+
Union<T extends TSchema[]>(schemas: [...T], options?: SchemaOptions): Union<T>;
|
|
101
101
|
Unknown(options?: SchemaOptions): TUnknown;
|
|
102
102
|
Unsafe<T>(options?: UnsafeOptions): TUnsafe<T>;
|
|
103
103
|
Uppercase<T extends TSchema>(schema: T, options?: SchemaOptions): TUppercase<T>;
|
|
@@ -14,4 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./union-evaluated"), exports);
|
|
18
|
+
__exportStar(require("./union-type"), exports);
|
|
17
19
|
__exportStar(require("./union"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnionCreate = void 0;
|
|
4
|
+
const type_1 = require("../clone/type");
|
|
5
|
+
const index_1 = require("../symbols/index");
|
|
6
|
+
function UnionCreate(T, options) {
|
|
7
|
+
return { ...options, [index_1.Kind]: 'Union', anyOf: (0, type_1.CloneRest)(T) };
|
|
8
|
+
}
|
|
9
|
+
exports.UnionCreate = UnionCreate;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SchemaOptions, TSchema } from '../schema/index';
|
|
2
|
+
import { type TNever } from '../never/index';
|
|
3
|
+
import { type TOptional } from '../optional/index';
|
|
4
|
+
import type { TReadonly } from '../readonly/index';
|
|
5
|
+
import type { TUnion } from './union-type';
|
|
6
|
+
type IsUnionOptional<T extends TSchema[]> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? L extends TOptional<TSchema> ? true : IsUnionOptional<R> : false);
|
|
7
|
+
declare function IsUnionOptional<T extends TSchema[]>(T: T): IsUnionOptional<T>;
|
|
8
|
+
type RemoveOptionalFromRest<T extends TSchema[]> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? L extends TOptional<infer S extends TSchema> ? [RemoveOptionalFromType<S>, ...RemoveOptionalFromRest<R>] : [L, ...RemoveOptionalFromRest<R>] : []);
|
|
9
|
+
declare function RemoveOptionalFromRest<T extends TSchema[]>(T: T): RemoveOptionalFromRest<T>;
|
|
10
|
+
type RemoveOptionalFromType<T extends TSchema> = (T extends TReadonly<infer S extends TSchema> ? TReadonly<RemoveOptionalFromType<S>> : T extends TOptional<infer S extends TSchema> ? RemoveOptionalFromType<S> : T);
|
|
11
|
+
declare function RemoveOptionalFromType<T extends TSchema>(T: T): RemoveOptionalFromType<T>;
|
|
12
|
+
type ResolveUnion<T extends TSchema[], R extends TSchema[] = RemoveOptionalFromRest<T>> = (IsUnionOptional<T> extends true ? TOptional<TUnion<R>> : TUnion<R>);
|
|
13
|
+
declare function ResolveUnion<T extends TSchema[]>(T: T, options: SchemaOptions): ResolveUnion<T>;
|
|
14
|
+
export type UnionEvaluated<T extends TSchema[]> = (T extends [] ? TNever : T extends [TSchema] ? T[0] : ResolveUnion<T>);
|
|
15
|
+
export declare function UnionEvaluated<T extends TSchema[], R = UnionEvaluated<T>>(T: [...T], options?: SchemaOptions): R;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnionEvaluated = void 0;
|
|
4
|
+
const index_1 = require("../symbols/index");
|
|
5
|
+
const type_1 = require("../clone/type");
|
|
6
|
+
const index_2 = require("../discard/index");
|
|
7
|
+
const index_3 = require("../never/index");
|
|
8
|
+
const index_4 = require("../optional/index");
|
|
9
|
+
const union_create_1 = require("./union-create");
|
|
10
|
+
const type_2 = require("../guard/type");
|
|
11
|
+
function IsUnionOptional(T) {
|
|
12
|
+
const [L, ...R] = T;
|
|
13
|
+
return (T.length > 0
|
|
14
|
+
? (0, type_2.TOptional)(L)
|
|
15
|
+
? true
|
|
16
|
+
: IsUnionOptional(R)
|
|
17
|
+
: false);
|
|
18
|
+
}
|
|
19
|
+
function RemoveOptionalFromRest(T) {
|
|
20
|
+
return (T.map(T => RemoveOptionalFromType(T)));
|
|
21
|
+
}
|
|
22
|
+
function RemoveOptionalFromType(T) {
|
|
23
|
+
return ((0, index_2.Discard)(T, [index_1.OptionalKind]));
|
|
24
|
+
}
|
|
25
|
+
function ResolveUnion(T, options) {
|
|
26
|
+
return (IsUnionOptional(T)
|
|
27
|
+
? (0, index_4.Optional)((0, union_create_1.UnionCreate)(RemoveOptionalFromRest(T), options))
|
|
28
|
+
: (0, union_create_1.UnionCreate)(RemoveOptionalFromRest(T), options));
|
|
29
|
+
}
|
|
30
|
+
function UnionEvaluated(T, options = {}) {
|
|
31
|
+
return (T.length === 0 ? (0, index_3.Never)(options) :
|
|
32
|
+
T.length === 1 ? (0, type_1.CloneType)(T[0], options) :
|
|
33
|
+
ResolveUnion(T, options));
|
|
34
|
+
}
|
|
35
|
+
exports.UnionEvaluated = UnionEvaluated;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TSchema } from '../schema/index';
|
|
2
|
+
import type { Static } from '../static/index';
|
|
3
|
+
import { Kind } from '../symbols/index';
|
|
4
|
+
type UnionStatic<T extends TSchema[], P extends unknown[]> = {
|
|
5
|
+
[K in keyof T]: T[K] extends TSchema ? Static<T[K], P> : never;
|
|
6
|
+
}[number];
|
|
7
|
+
export interface TUnion<T extends TSchema[] = TSchema[]> extends TSchema {
|
|
8
|
+
[Kind]: 'Union';
|
|
9
|
+
static: UnionStatic<T, this['params']>;
|
|
10
|
+
anyOf: T;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import type { TSchema, SchemaOptions } from '../schema/index';
|
|
2
|
-
import type { Static } from '../static/index';
|
|
3
2
|
import { type TNever } from '../never/index';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
export declare function UnionResolve<T extends TSchema[]>(T: [...T]): UnionResolve<T>;
|
|
8
|
-
export interface TUnion<T extends TSchema[] = TSchema[]> extends TSchema {
|
|
9
|
-
[Kind]: 'Union';
|
|
10
|
-
static: {
|
|
11
|
-
[K in keyof T]: T[K] extends TSchema ? Static<T[K], this['params']> : never;
|
|
12
|
-
}[number];
|
|
13
|
-
anyOf: T;
|
|
14
|
-
}
|
|
15
|
-
export declare function Union<T extends TSchema[]>(T: [...T], options?: SchemaOptions): UnionResolve<T>;
|
|
3
|
+
import type { TUnion } from './union-type';
|
|
4
|
+
export type Union<T extends TSchema[]> = (T extends [] ? TNever : T extends [TSchema] ? T[0] : TUnion<T>);
|
|
5
|
+
export declare function Union<T extends TSchema[]>(T: [...T], options?: SchemaOptions): Union<T>;
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Union =
|
|
3
|
+
exports.Union = void 0;
|
|
4
4
|
const index_1 = require("../never/index");
|
|
5
|
-
const index_2 = require("../modifiers/index");
|
|
6
5
|
const type_1 = require("../clone/type");
|
|
7
|
-
const
|
|
8
|
-
function UnionResolve(T) {
|
|
9
|
-
return (T.length === 0 ? (0, index_1.Never)() :
|
|
10
|
-
T.length === 1 ? T[0] :
|
|
11
|
-
(0, index_2.OptionalFromUnion)(T));
|
|
12
|
-
}
|
|
13
|
-
exports.UnionResolve = UnionResolve;
|
|
6
|
+
const union_create_1 = require("./union-create");
|
|
14
7
|
function Union(T, options = {}) {
|
|
15
8
|
return (T.length === 0 ? (0, index_1.Never)(options) :
|
|
16
9
|
T.length === 1 ? (0, type_1.CloneType)(T[0], options) :
|
|
17
|
-
|
|
18
|
-
});
|
|
10
|
+
(0, union_create_1.UnionCreate)(T, options));
|
|
19
11
|
}
|
|
20
12
|
exports.Union = Union;
|
|
@@ -17,7 +17,7 @@ export declare const Delete: import("../../type/object/object").TObject<{
|
|
|
17
17
|
path: import("../../type/string/string").TString;
|
|
18
18
|
}>;
|
|
19
19
|
export type Edit = Static<typeof Edit>;
|
|
20
|
-
export declare const Edit: import("../../type/union/union").TUnion<[import("../../type/object/object").TObject<{
|
|
20
|
+
export declare const Edit: import("../../type/union/union-type").TUnion<[import("../../type/object/object").TObject<{
|
|
21
21
|
type: import("../../type/literal/literal").TLiteral<"insert">;
|
|
22
22
|
path: import("../../type/string/string").TString;
|
|
23
23
|
value: import("../../type/unknown/unknown").TUnknown;
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -65,9 +65,9 @@ License MIT
|
|
|
65
65
|
- [Types](#types)
|
|
66
66
|
- [Json](#types-json)
|
|
67
67
|
- [JavaScript](#types-javascript)
|
|
68
|
+
- [Modules](#types-modules)
|
|
68
69
|
- [Options](#types-options)
|
|
69
70
|
- [Properties](#types-properties)
|
|
70
|
-
- [Modular](#types-modular)
|
|
71
71
|
- [Generics](#types-generics)
|
|
72
72
|
- [References](#types-references)
|
|
73
73
|
- [Recursive](#types-recursive)
|
|
@@ -644,6 +644,28 @@ TypeBox provides an extended type set that can be used to create schematics for
|
|
|
644
644
|
└────────────────────────────────┴─────────────────────────────┴────────────────────────────────┘
|
|
645
645
|
```
|
|
646
646
|
|
|
647
|
+
<a name='types-modules'></a>
|
|
648
|
+
|
|
649
|
+
### Type Modules
|
|
650
|
+
|
|
651
|
+
TypeBox uses a modular type system and supports selective type imports. Using selective imports can be useful in resource constrained environments as the technique allows modern bundlers to tree shake unused types. This can reduce overall bundle sizes.
|
|
652
|
+
|
|
653
|
+
```typescript
|
|
654
|
+
import { Object, Number, String, Boolean, type Static } from '@sinclair/typebox'
|
|
655
|
+
|
|
656
|
+
const T = Object({ // const T: TObject<{
|
|
657
|
+
x: Number(), // x: TNumber,
|
|
658
|
+
y: String(), // y: TString,
|
|
659
|
+
z: Boolean() // z: TBoolean
|
|
660
|
+
}) // }>
|
|
661
|
+
|
|
662
|
+
type T = Static<typeof T> // type T = {
|
|
663
|
+
// x: number,
|
|
664
|
+
// y: string,
|
|
665
|
+
// z: boolean
|
|
666
|
+
// }
|
|
667
|
+
```
|
|
668
|
+
|
|
647
669
|
<a name='types-options'></a>
|
|
648
670
|
|
|
649
671
|
### Options
|
|
@@ -717,20 +739,6 @@ Object properties can be modified with Readonly and Optional. The following tabl
|
|
|
717
739
|
└────────────────────────────────┴─────────────────────────────┴────────────────────────────────┘
|
|
718
740
|
```
|
|
719
741
|
|
|
720
|
-
<a name='types-modular'></a>
|
|
721
|
-
|
|
722
|
-
### Modular Types
|
|
723
|
-
|
|
724
|
-
TypeBox implements a modular type system. The following imports the full type system (recommended)
|
|
725
|
-
|
|
726
|
-
```typescript
|
|
727
|
-
import { Type } from '@sinclair/typebox' // 36.5 kb minified
|
|
728
|
-
```
|
|
729
|
-
The following imports types individually which enables modern bundlers to optimize bundle sizes via tree shaking.
|
|
730
|
-
```typescript
|
|
731
|
-
import { Object, Number } from '@sinclair/typebox' // 6.4 kb minified
|
|
732
|
-
```
|
|
733
|
-
|
|
734
742
|
<a name='types-generics'></a>
|
|
735
743
|
|
|
736
744
|
### Generic Types
|
|
@@ -950,7 +958,7 @@ const M = Type.Mapped(Type.KeyOf(T), K => { // type M = {
|
|
|
950
958
|
|
|
951
959
|
### Template Literal Types
|
|
952
960
|
|
|
953
|
-
TypeBox supports
|
|
961
|
+
TypeBox supports template literals with Type.TemplateLiteral. This type can be created using a syntax similar to the TypeScript template literal syntax or composed from exterior types. TypeBox encodes template literals as regular expression patterns which enables the template to be checked by Json Schema validators. This type also supports regular expression parsing, enabling template patterns to be used for generative types. The following shows both TypeScript and TypeBox usage.
|
|
954
962
|
|
|
955
963
|
```typescript
|
|
956
964
|
// TypeScript
|
|
@@ -1808,11 +1816,11 @@ The following table lists esbuild compiled and minified sizes for each TypeBox m
|
|
|
1808
1816
|
┌──────────────────────┬────────────┬────────────┬─────────────┐
|
|
1809
1817
|
│ (index) │ Compiled │ Minified │ Compression │
|
|
1810
1818
|
├──────────────────────┼────────────┼────────────┼─────────────┤
|
|
1811
|
-
│ typebox/compiler │ '118.
|
|
1819
|
+
│ typebox/compiler │ '118.7 kb' │ ' 52.5 kb' │ '2.26 x' │
|
|
1812
1820
|
│ typebox/errors │ ' 55.1 kb' │ ' 25.2 kb' │ '2.19 x' │
|
|
1813
1821
|
│ typebox/system │ ' 4.6 kb' │ ' 2.0 kb' │ '2.31 x' │
|
|
1814
|
-
│ typebox/value │ '144.
|
|
1815
|
-
│ typebox │ ' 87.
|
|
1822
|
+
│ typebox/value │ '144.8 kb' │ ' 61.8 kb' │ '2.34 x' │
|
|
1823
|
+
│ typebox │ ' 87.7 kb' │ ' 36.7 kb' │ '2.39 x' │
|
|
1816
1824
|
└──────────────────────┴────────────┴────────────┴─────────────┘
|
|
1817
1825
|
```
|
|
1818
1826
|
|