Typescript object casting not working
<p>I got an HTTP API.
I am loading a set of objects as a json.</p>

<p>I want to cast to a Typescript object, but with the keyword "as" it is not working and even not with &lt; Type > in front of the object.</p>

<pre><code>r.forEach(entry =&gt; {
    entry.creationDate = new Date(entry.creationDate.date);
    entry.creator = &lt;User&gt;entry.creator;
    return entry;
});
</code></pre>

<p>The console.log directly after entry.creator casting outputs a normal "Object".</p>

<p>Can someone give me an advice?</p>