CodeGen: Fixes TypeScript type mapping condition

Fixes #1334.