Closed beac0n closed 6 years ago
@beac0n thanks for opening this issue, this is not a bug though. The following line throws in development
var x = TestStruct({test: false})
so everything comes after is not reliable and can't be used as a repro.
@gcanti thanks for the quick answer.
How should I use tcomb for this use case in production then? Should I use tcomb in production at all? Can you provide an example on how to use it properly in a production environment?
Thanks :)
@beac0n tcomb
is a runtime type system and is supposed to be used in development and disabled in production. If you want checks in production (for example for validating input, payloads etc..) you may want tcomb-validation
(also if you are using typescript, check out io-ts which is written specifically for ts).
Thanks a lot for clearing this up. Do you mind if I create a pull request to highlighting that type validation is disabled in production?
Sure, thanks
Version
3.2.27
Expected behaviour
Actual behaviour
Steps to reproduce
run the script above with NODE_ENV="production"