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

163
Views
¿Existe una forma compatible con TypeScript de camelizar todas las claves en un objeto/matriz?

Ya he tenido una función funcionando correctamente.

 const camelizeKeys = (obj: any): any => { if (Array.isArray(obj)) { return obj.map((v) => camelizeKeys(v)) // camelizeKeys is a function in lodash. } else if (obj != null && obj.constructor === Object) { return Object.keys(obj).reduce( (result, key) => ({ ...result, [camelCase(key)]: camelizeKeys(obj[key]) }), {} ) } return obj }

Sin embargo, usó any explícito en el tipo de parámetro y valor de retorno. ¿Es posible expresar el tipo de una mejor manera (por ejemplo, inferir el tipo de valor de retorno del tipo de parámetro)?

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!