GoogleFeud / ts-runtime-checks

A typescript transformer that automatically generates validation code from your types.
https://googlefeud.github.io/ts-runtime-checks/
MIT License
312 stars 7 forks source link

[BUG] NoCheck<string | null> or NoCheck<string | undefined> fails with "Maximum call stack exceeded" #29

Closed FredTreg closed 1 year ago

FredTreg commented 1 year ago

Describe the bug When using an Assert<> on a type with a NoCheck<sometype | null> field, the compiler fails with RangeError: Maximum call stack size exceeded.

The same happens with undefined.

Playground link playground

Expected behavior Compiler does not fail

Additional context 0.3.2