suretype icon indicating copy to clipboard operation
suretype copied to clipboard

Type-ensured validator should assert return type

Open dbartholomae opened this issue 4 years ago • 0 comments

Hi there!

Currently I have to manually do this:

export const assertPostMetaData: (
  data: unknown
) => asserts data is PostMetaData = compile(postMetaDataSchema, {
  ensure: true,
});

Would be nice if this type definition could be baked into suretype. I might be able to provide a PR :)

dbartholomae avatar Dec 11 '21 21:12 dbartholomae