title: Super weird issue where typescript/javascript behavior on staging environment differs from localhost
body: <p>Here's an example of the code I have:</p>
  
  <pre><code>function getDefault() {
    return {
      foo: 'a'
    }
  }
  
  function getBar() {
    bar: any = getDefault();
    bar.bar = 'b';
  }
  
  function getCat() {
    cat: any = getDefault();
    cat.cat = 'c';
  }
  
  ...
  console.log(getBar());
  console.log(getCat());
  </code></pre>
  
  <p>This code outputs the following when I run locally:</p>
  
  <pre><code>{ foo: 'a', bar: 'b' }
  { foo: 'a', cat: 'c' }
  </code></pre>
  
  <p>But when I run this on my staging environment, I get the following:</p>
  
  <pre><code>{ foo: 'a', bar: 'b', cat: 'c' }
  { foo: 'a', bar: 'b', cat: 'c' }
  </code></pre>
  
  <p>Super weird. In order to fix this I modified the functions to call getDefault like this <code>{...getDefault()}</code>:</p>
  
  <pre><code>function getBar() {
    bar: any = {...getDefault()};
    bar.bar = 'b';
  }
  
  function getCat() {
    cat: any = {...getDefault()};
    cat.cat = 'c';
  }
  </code></pre>
  
  <p>Basically I'm explicitly cloning the object returned by getDefault().</p>
  
  <p>Anyone understand why this might be happening? I'm using <code>tsc</code> to transpile typescript and webpack to bundle. </p>