Skip to content

docs: correct the URL example in snakeizeKeysDeep's JSDoc - #2019

Closed
zunixport wants to merge 1 commit into
ProjectOpenSea:mainfrom
zunixport:fix/snakeize-keys-deep-javadoc-url-example
Closed

zunixport wants to merge 1 commit into
ProjectOpenSea:mainfrom
zunixport:fix/snakeize-keys-deep-javadoc-url-example

Conversation

@zunixport

Copy link
Copy Markdown
Contributor

Summary

The JSDoc for snakeizeKeysDeep claimed URL → url. The function actually
returns u_r_l. Comment-only fix; no runtime change.

The bug

camelToSnake splits every uppercase character after position 0:

key.replace(/[A-Z]/g, (ch, i) =>
  i === 0 ? ch.toLowerCase() : `_${ch.toLowerCase()}`,
)

@ryanio

ryanio commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator

Thanks @zunixport, you're right that URL comes out as u_r_l. This repo is a read-only mirror of our monorepo, so I recreated the fix there in ProjectOpenSea/opensea-devtools#784 (now merged) with you credited as co-author. I kept the one-word correction and dropped the extra sentence, since camelToSnake already documents the position-0 guard. The same wrong example was in the 11.0.0 CHANGELOG entry, so that's fixed too. It will ship in the next sdk release. Closing this one since mirror PRs can't be merged directly.

@ryanio ryanio closed this Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants