Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array values being transformed #7

Open
tmclaugh opened this issue Aug 23, 2016 · 6 comments
Open

Array values being transformed #7

tmclaugh opened this issue Aug 23, 2016 · 6 comments

Comments

@tmclaugh
Copy link

I'm not sure if the behavior regarding array values is correct.

https://github.com/BinaryThumb/change-case-object/blob/master/index.js#L9-L15

Arrays only contain values so if the value is a string, and not another object, is should likely have its case remain unchanged. I noticed this while trying to return some AWS EC2 instance information and found my instance IDs going from kebab case to snake case. How should this be handled? Optional flag on functions so compatibility is preserved?

@ddmng
Copy link

ddmng commented Jun 20, 2018

Hi @tmclaugh ,
I have the same issue, have you find a workaround in the meantime?

@tmclaugh
Copy link
Author

@ddmng I'm not even sure what caused me to file this anymore.

@ddmng
Copy link

ddmng commented Jun 20, 2018

We're close the this issue's 2nd birthday!
Anyway, if you need, I fixed it in ddmng@21ab167 but suspect that the original behaviour was intentional for some reason

@brycesenz
Copy link

I would be a big fan of this being merged into this main project, at least as a configurable option.

@swapnil2993
Copy link

Is this fix going to be released?

@markusand
Copy link

Already 2021 and this bug isn't fixed, nor @ddmng 's PR accepted. I'm just facing this problem with an object containing an array of string dates in ISO-8601.

{
    available_dates: ['2021-03-01T00:00:00Z', '2021-03-02T00:00:00Z', '2021-03-03T00:00:00Z'],
}

Dates are converted 2021-03-03T00:00:00Z being converted to 2021_03_03T00:00:00Z, even with camelCase() being used.

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

No branches or pull requests

5 participants