Skip to content

Instantly share code, notes, and snippets.

@B4nan
Created February 6, 2022 16:20
Show Gist options
  • Save B4nan/9ff8b869e968f01906279181d2d6b5de to your computer and use it in GitHub Desktop.
Save B4nan/9ff8b869e968f01906279181d2d6b5de to your computer and use it in GitHub Desktop.
const book = {} as Book;
const dto = wrap(book).toObject(); // EntityDTO<Book>
// this is now possible, but with the PK union type, we would need to type cast all the time
const name = dto.author.name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment