This repository was archived by the owner on Feb 26, 2021. It is now read-only.

Description
What I wrote:
const type = oc(questionSet).questions[initialQuestionId].type();
Output after compilation with transformer (formatted for readability):
const type =
questionSet != null &&
questionSet.questions != null &&
questionSet.questions.initialQuestionId != null &&
questionSet.questions.initialQuestionId.type != null
? questionSet.questions.initialQuestionId.type
: undefined;
However, initialQuestionId is not the name of the key but a variable reference to another string with the property name, the compiled code should look something like:
const type =
questionSet != null &&
questionSet.questions != null &&
questionSet.questions[initialQuestionId] != null &&
questionSet.questions[initialQuestionId].type != null
? questionSet.questions[initialQuestionId].type
: undefined;
This is using typescript 3.5.3.