Closed ngocthoaia1 closed 5 years ago
Same issue here. What is weird in my case is that this was working fine a few days ago, but suddenly stopped when I tried it today.
@issuehunt has funded $40.00 to this issue.
While I'm not submitting a PR to this, if anyone lands on this problem here's the a little script that you can add to your utils https://gist.github.com/abhn/cdfbdce6bf8a1e7be3750fd6607e6096
Code copied from https://matthiashager.com/converting-snake-case-to-camel-case-object-keys-with-javascript
Not as efficient as the library, but for smaller json files, shouldn't be that huge of a problem.
@ngocthoaia1 I'm not able to replicate this bug, at least with the latest version on Node.js. Where/how are you running this?
@abhn Can you point to some reproduction steps? What was nodejs version/browser at least?
@abhn @ngocthoaia1
Yeah, I Cannot reproduce it either.
I tried with all the following node versions
v6.2.2
v7.10.0
v8.9.0
v8.9.4
v8.11.3
v9.5.0
it worked fine with all these versions, would be great to know steps to reproduce this issue.
Apologies for not getting back.
My node version is 8.9.1
and my camelcase-keys version is 2.1.0
.
I'll try to install this project in another test setup and try to reproduce the issue there. But like I mentioned in my post, it did work fine for me for sometime and then faced the issue mentioned by OP so not sure.
I'll get back. I'm wondering if it has anything to do with the data supplied to the function.
@abhn sure, let us know what data object you are sending, if it breaks.
deep
option was introduced in v4.0.0 (https://github.com/sindresorhus/camelcase-keys/commit/94195701442b3ab257d17596a689780656a172ec).
I too was having this issue with deep not working on nested objects. Since I knew it was working in a previous project, I downgraded to camelcase-keys@5.2.0 and it worked. I then tried v6.0.0 then c6.0.1 and they worked too.
Now I couldn't reproduce the issue. It didn't make any sense. I looked through all my dependencies and discovered node-sass was installing meow which was then installing camelcase-keys@2.1.0 for some reason (same version @abhn mentioned). I started a new project with just node-sass installed and sure enough the nested object issue came back.
So for me anyway it turned out another package had installed a older version of camelcase-keys instead of the latest version. Perhaps Op was experiencing a similar issue.
Can confirm this trouble with camelcase-keys@6.0.1 and dependency from meow package (camelcase-keys@2.1.0)
@all So sorry for late reply, I miss the notifications. @romanlex I checked again and see "camelcase-keys" package don't have any problem. The problem seem I use too old version of "camelcase-keys" I use meow package too and it require
"requires": {
"camelcase-keys": "^2.0.0",
I think can close this issue right now. Thank you a lots for you help!
@sindresorhus has cancelled @issuehunt's funding for this issue.(Cancelled amount: $40.00) See it on IssueHunt
IssueHunt Summary
### Backers (Total: $0.00) #### [Become a backer now!](https://issuehunt.io/r/sindresorhus/camelcase-keys/issues/32) #### [Or submit a pull request to get the deposits!](https://issuehunt.io/r/sindresorhus/camelcase-keys/issues/32) ### Tips - Checkout the [Issuehunt explorer](https://issuehunt.io/r/sindresorhus/camelcase-keys/) to discover more funded issues. - Need some help from other developers? [Add your repositories](https://issuehunt.io/r/new) on IssueHunt to raise funds. --- IssueHunt has been backed by the following sponsors. [Become a sponsor](https://issuehunt.io/membership/members)