As I mentioned above, never check for values this way.  Instead do something like `typeof icon !== 'undefined' ? new ConstantProperty(icon) : undefined;`  I won't comment any more, but change this throughout the code.