title: Argument of type is not assignable to string
body: <p>I have a formatted json data that I want to use in d3 to draw a hierarchy. It was working with old data but after adding more dimension in the json data, its giving following error. </p>
  
  <p>Argument of type '{ name: string; children: { group: number; name: string; }[]; group: number; }[]' is not assignable to parameter of type 'readonly string[]'.
  Type '{ name: string; children: { group: number; name: string; }[]; group: number; }' is not assignable to type 'string'.</p>
  
  <p>The output of my reformatted data is following which is generated by using the code from @Dacre Denny's answer from  <a href="https://stackoverflow.com/questions/59448748/change-json-data-into-new-format-by-javascript/59448945?noredirect=1#comment105082157_59448945">Change Json data into new format by JavaScript</a> link </p>
  
  <pre><code>{
    name: "program",
    children: (1)[
      {
        name: "file1",
        children: (1)[
          {
            name: "function1",
            calls: (2)[
              {
                line: 105,
                file: "file2",
                function: "function5"
              },
              {
                line: 106,
                file: "file2",
                function: "function6"
              }
            ],
            point: (2)[
              102,
              105
            ],
            point2: (3)[
              (2)[
                102,
                102
              ],
              (3)[
                105,
                106,
                107
              ],
              (2)[
                106,
                107
              ]
            ],
            group: 1
          }
        ],
        group: 1
      }
    ],
    group: 0
  }
  </code></pre>
  
  <p>My existing code snippet for d3 is following:</p>
  
  <pre><code>const data = TestFunction.test(); //from here i am calling the reformatted output
  const root = d3.hierarchy(data);
  
  const colorScale = d3.scaleOrdinal()
          .domain(data.children) // here its showing the error.
          .range(d3.schemeCategory10);
  </code></pre>
  
  <p>I would really appreciate your help.</p>