v3.1.0
Features
-
// NOTE: Allows any value! // --- let x = t.unknown(); //-> { } type X = t.Infer<typeof x>; //-> unknown
-
Add
partial
modifier: 56041e6
Accepts at.object
and marks all its fields as optional (not required).let person1 = t.object({ name: t.string(), age: t.number(), }); type Person1 = t.Infer<typeof person1>; //-> { //-> name: string; //-> age: number; //-> } // NOTE: The input (`person1`) is not modified let person2 = t.partial(person1); type Person2 = t.Infer<typeof person2>; //-> { //-> name?: string; //-> age?: number; //-> } // NOTE: equivalent to person2 let person3 = t.object( name: t.optional(t.string()), age: t.optional(t.number()), }); type Person3 = t.Infer<typeof person3>; //-> { //-> name?: string; //-> age?: number; //-> }
Patches
- (types): Add default
object
type arg: ac25ad7
This means that you can now import/extend thet.object
type directly.
Chores
- Update module size: 22ee312
NOTE: Everything is still tree-shakable!
In other words, if you don't use the new methods, you don't import those bytes.
Full Changelog: v3.0.0...v3.1.0