Skip to content

Instantly share code, notes, and snippets.

@colinhacks
Created March 8, 2020 22:54
Show Gist options
  • Save colinhacks/d1e20ba88cfba708360937726deeed58 to your computer and use it in GitHub Desktop.
Save colinhacks/d1e20ba88cfba708360937726deeed58 to your computer and use it in GitHub Desktop.
const A = t.type({
foo: t.string,
});
const B = t.partial({
bar: t.number,
});
const C = t.intersection([A, B]);
type C = t.TypeOf<typeof C>;
// {
// foo: string;
// bar?: number | undefined
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment