Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/utils/case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ function snakeToCamel(key: string): string {
* format the API expects.
*
* **Acronym caveat:** every uppercase character emits its own underscore, so
* acronym-style keys are split between letters: `URL` → `url`,
* `userID` → `user_i_d`, `NFTContract` → `n_f_t_contract`. This is deliberate
* acronym-style keys are split between letters: `URL` → `u_r_l`,
* `userID` → `user_i_d`, `NFTContract` → `n_f_t_contract`. Only the position-0
* guard keeps a leading capital from becoming a leading underscore, so `URL`
* loses none of its inner splits. This is deliberate
* (the roundtrip with `camelizeKeysDeep` is consistent under generic rules)
* but consumers calling `snakeizeKeysDeep` directly should avoid PascalCase
* acronyms in key names — use `userId` / `nftContract` instead.
Expand Down