CodeGen: Fixes TypeScript type mapping condition.
Fixes #1334.
Merge pull request #1362 from am11/master

CodeGen: Fixes TypeScript type mapping condition