ByContract

byContract is a small validation library (1,1 KB gzip) that allows you to benefit from Design by Contract programming
in your JavaScript code. The lib uses JSDoc expression for a contract. Therefore you
likely already familiar with the syntax. The library is implemented as a UMD-compatible module, so you can use as CommonJs and AMD.
Besides, it exposes byContract function globally when window object available, meaning you can still use it in non-modular programming.