Skip to content

DeptUK/byteguards

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BYTE/DEPT® TypeGuards

(AKA ByteGuards)

This is a library for having typeguards at runtime boundaries, in addition to the native TS compile time checking. The purpose of this is to provide more information when variables fail type-guards, but also to ensure that when data comes back from an API, DB call etc, that it is of the type that we expect. This adds some overhead at run-time, but with the benefit of providing complete type security.

We have found it to be superior to other libraries such as io-ts and Spicery, and ts-runtime which runs in Babel, as there is a clearer indicator of what is going on, as well as verbose messages if you want them. In addition, with the use of GitHub CoPilot, we have found the 'manual' generation of TypeGuards quick and easy.

It was inspired by this article, written back in 2018.

License

Distributed under the MIT License. See LICENSE.txt for more information.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published