Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

128
Views
How to convert Array Object to string literal in typescript?

For example:

I want to change this

interface typeA {
    name:string;
    children?:typeA[];
}

const a:typeA[] = [
    {
        name: 'b',
        children: [
            {
                name: 'c'
            }
        ]
    },
    {
        name: 'd',
        children: [
            {
                name: 'e',
                children: [
                    {
                        name: 'f'
                    }
                ]
            }
        ]
    }
];

To this

type A = 'b' | 'b.c' | 'd' | 'd.e' | 'd.e.f';

So, I want to convert Array Object to String literal, is it possible to do this?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!