Skip to content

v3.2.0

Latest
Compare
Choose a tag to compare
@lukeed lukeed released this 12 Oct 11:21

Features

  • Add t.dict export: 20d2bbd, d40b952
    Adds a JSON Schema builder for the Record<string, T> TypeScript equivalent.

    import * as t from 'tschema';
    
    let names = t.dict(t.string());
    type Names = t.Infer<typeof names>;
    //-> Record<string, string>
    
    let mates = t.dict(
      t.object({
        name: t.string(),
        age: t.integer(),
      })
    );
    type Mates = t.Infer<typeof mates>;
    //-> Record<string, {
    //->   name: string;
    //->   age: number;
    //-> }>

Patches

  • Add explicit return type for t.partial signature: 11b12c3

Chores


Full Changelog: v3.1.0...v3.2.0