FiloSottile / typage

A TypeScript implementation of the age file encryption format, based on libsodium.
BSD 3-Clause "New" or "Revised" License
64 stars 9 forks source link

Split the README examples into blocks so the full code sample is valid. #12

Closed lgarron closed 8 months ago

lgarron commented 8 months ago

The previous version re-declared const variable. If you copied the entire sample code (e.g. using the copy button that GitHub adds to the upper right of the code block) into a file, you would get TypeScript errors and runtime errors.

By wrapping each example in a block statement, we avoid the const conflicts so that both snippets can live in the same source.