api-client-generator
api-client-generator copied to clipboard
About 'ngx-model-guards-export.mustache' template
Hello,
Why the boolean expression of generated type guards is always terminated by true
?
see line 32 of 'ngx-model-guards-export.mustache' template.
Thank for your help.
@sebnic hello, the intended logic here is to combine all checks for the type with and operation
(&&
) so for the convenience of generated code we end the checks with true
.
This can be interpreted as, if there are no falsy checks along the way, it is true.