title: What's the best way to turn all the keys of an nested array of objects to a camel case?
body: <p>I want to turn all the keys of my array of objects to a camelCase in Typescript. I have the following data:</p>
  <pre><code>[
      {
         &quot;Name&quot;:&quot;Custom property&quot;,
         &quot;Details&quot;:{
            &quot;Address&quot;:&quot;Huston&quot;,
            &quot;Price&quot;:&quot;1000000&quot;,
         },
         &quot;Contact&quot;:{
            &quot;Global&quot;:&quot;3432432&quot;,
            &quot;Local&quot;:&quot;432423423&quot;
         },
      },
      {
         &quot;Name&quot;:&quot;Myproperty&quot;,
         &quot;Details&quot;:{
            &quot;Address&quot;:&quot;Huston&quot;,
            &quot;Price&quot;:&quot;10000001&quot;,
         },
         &quot;Contact&quot;:{
            &quot;Global&quot;:&quot;34324323&quot;,
            &quot;Local&quot;:&quot;4324234233&quot;
         },
      },
  ]
  </code></pre>
  <p>I have tried the below code, but it returns a new dictionary only with the details. How can I resolve that?</p>
  <pre><code>const newObjOptions = options.map((obj: any) =&gt;
      Object.fromEntries(
        Object.entries(obj).map(([k, v]) =&gt; [_.camelCase(k), v])
      )
    );
    const newObjDetailsOptions = newObjOptions.map((obj: any) =&gt;
      Object.fromEntries(
        Object.entries(obj.details).map(([k, v]) =&gt; [_.camelCase(k), v])
      )
    );
  </code></pre>