Flattening the nested Objects
Review


Your final return statement is redundant.
The use of const is correct here (rawObjectKey, rawObjectValue) because you only assign these variables once. Many developers tend to use let or var here incorrectly.
Your method is a bit convoluted with those almost-equal code blocks. convertedObject = {...convertedObject, ...




Alternative

You could write this more compact, DRY and using built-in function reduce. We start with an empty object {} and inject each entry with the flattened data to obtain the result.

 const convertedObject = Object.entries(rawObject).reduce(
  (acc, item) =&gt; { 
    acc[item[0]] = item[1] != null ? item[1].value : null;
    return acc;
  }, {});




Future Releases

There is a thing called optional chaining aka null propagation aka the Elvis operator. It's not standard Typescript (yet?), but is already supported in babel-plugin-proposal-optional-chaining.

This is a feature request to track. If ever implemented, it would allow us to call something like item[1]?.value:null instead of item[1] != null ? item[1].value : null.