question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature snake_case to camelCase conversion option

See original GitHub issue

I went through docs i couldn’t find anything that let me convert snake_case to CamelCase using plainToClass In many cases json returning from API’s are mostly snake_case but my classes contain CamelCase properties. it would be nice to have something like below. Just a thought can be implement in @f decorator as well to be able to covert in both plainToClass and classToPlain.

e.g const post = plainToClass(Post, postJson, {snakeToCamel: true});

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
marcjcommented, Feb 7, 2020

Constructor with asName is not a great replacement for your need. Better is to way for the weekend, then I think we figured something out.

0reactions
marcjcommented, Dec 3, 2022

Naming strategy was implemented a long time ago. I’m going to close this, but feel free to reopen if anything else needs to be addressed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Convert Snake Case string to Camel Case in Java
Method 1: Using Traversal. The idea is to first capitalize the first letter of the string. Then convert the string to string builder....
Read more >
javascript - How to convert snake case to camelcase in my app
camelCase () to generate a function that takes the 2nd param (the key ) instead of the 1st param (the value ). var...
Read more >
Camel case vs. snake case: What's the difference?
Camel case and snake case are popular naming conventions, but they serve very different functions in languages such as Java and JavaScript.
Read more >
Convert Strings into any Case • snakecase
The to_any_case() function basically enables you to convert any string into any case. ... In this case, another parsing option might be handy:....
Read more >
Convert String to Different Case Styles ... - In Plain English
Conversion from string to different ways of word combination in JavaScript. · 1. Snake case · 2. Kebab case · 3. Camel case...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found