You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: changelog/1.0.0-migration.md
+41-7Lines changed: 41 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,14 @@ This document covers upgrading from TypeBox 0.34.x to 1.0. While most of the API
6
6
7
7
## Contents
8
8
9
-
-[ESM Package](#ESM)
10
9
-[Kind, Hint, ReadonlyKind and OptionalKind](#Symbols)
11
10
-[Type.Date and Type.Uint8Array](#Globals)
12
11
-[Type.Recursive](#Recursive)
13
12
-[Type.RegExp](#RegExp)
14
13
-[Type.Composite](#Composite)
15
14
-[Type.Transform](#Transform)
16
15
-[Type.Const](#Const)
16
+
-[Type.Pick and Type.Omit](#PickOmit)
17
17
-[TypeCompiler](#TypeCompiler)
18
18
-[References](#References)
19
19
-[FormatRegistry](#FormatRegistry)
@@ -24,12 +24,6 @@ This document covers upgrading from TypeBox 0.34.x to 1.0. While most of the API
24
24
-[SetErrorFunction](#SetErrorFunction)
25
25
-[CustomErrors](#CustomErrors)
26
26
27
-
<aname="ESM"></a>
28
-
29
-
## ESM Package
30
-
31
-
Version 1.0 is published as an ESM-only package. Users will need to ensure their environments support ESM module resolution.
32
-
33
27
<aname="Symbols"></a>
34
28
35
29
## Kind, Hint, ReadonlyKind and OptionalKind
@@ -273,6 +267,46 @@ const S = Type.Script({ T }, `{
273
267
// }>
274
268
```
275
269
270
+
<aname="PickOmit"></a>
271
+
272
+
## Type.Pick and Type.Omit
273
+
274
+
Version 1.0 updates Pick and Omit to return evaluated Object types when applied to Union and Intersect types. This change aligns with V1’s ability to evaluate logical type expressions for mapped types. As a consequence, the return structures of Pick and Omit may vary depending on the source type being used.
275
+
276
+
In 0.34.x, Pick and Omit would simply traverse a logical type expression and select properties from embedded Object types. In 1.0, Pick and Omit evaluate the result into a normalized Object type. Both 0.34.x and 1.0 return semantically equivalent types, but in 1.0 the result is reduced to its simplest form.
0 commit comments