sindresorhus/camelcase-keys

Allow paths to be excluded from transformation #23

mojavelinux posted onGitHub

Allow certain paths to be excluded from transformation (excludePaths). This is necessary when certain subpaths of the structure hold pure data that are not part of the model. For example, one of the keys might hold key-value pair data, but that key-value pair data cannot be corrupted.

I'm imagining something like:

camelcaseKeys(raw, { deep: true, excludePaths: ['path.to.hash'] })

It would be the data inside this path, not the path itself, that would be excluded.


Sounds like a valid use-case. PR welcome.

posted by sindresorhus almost 7 years ago

Great. That's what I needed to know.

posted by mojavelinux almost 7 years ago

I was thinking about this question of whether the specified path itself should be excluded, or whether it just excludes its children. That got me thinking that perhaps the right name for the option is "stopPaths" instead of "excludePaths". (And, of course, this is related to the deep option). I'm open to suggestions, and that can be tuned once we're looking at some code.

posted by mojavelinux almost 7 years ago

@issuehunt has funded $60.00 to this issue.


posted by IssueHuntBot almost 6 years ago

@sindresorhus has rewarded $54.00 to @stroncium. See it on IssueHunt

  • :moneybag: Total deposit: $60.00
  • :tada: Repository reward(0%): $0.00
  • :wrench: Service fee(10%): $6.00
posted by issuehunt-app[bot] over 5 years ago

Fund this Issue

$60.00
Rewarded

Rewarded pull request

Recent activities

stroncium was rewarded by sindresorhus for sindresorhus/camelcase-keys# 23
over 5 years ago
stroncium submitted an output to  sindresorhus/ camelcase-keys# 23
almost 6 years ago