Skip to content

Instantly share code, notes, and snippets.

@dgieselaar
Last active September 9, 2019 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgieselaar/9af5e8dc30309ed2b312e81a45766cba to your computer and use it in GitHub Desktop.
Save dgieselaar/9af5e8dc30309ed2b312e81a45766cba to your computer and use it in GitHub Desktop.
import * as t from 'io-ts';
/*
This codec represents the following TypeScript type:
{
title: string,
content: string,
options: {
private?: boolean
}
}
*/
const codec = t.type({
title: t.string,
content: t.string,
options: t.partial({
private: t.boolean,
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment