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

flatten_map/1 does not flatten lists #5

Open
vrcca opened this issue Oct 9, 2020 · 1 comment
Open

flatten_map/1 does not flatten lists #5

vrcca opened this issue Oct 9, 2020 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested technical A technical issue that requires understanding of the code, infrastructure or dependencies

Comments

@vrcca
Copy link
Collaborator

vrcca commented Oct 9, 2020

Given the following structure:

%{items: [%{id: 1}, %{id: 2}], another: %{key: :value}}

I would expect the following result:

%{another__key: :value, items__0__id: 1, items__1__id: 2}

But we actually get:

%{another__key: :value, items: [%{id: 1}, %{id: 2}]}

I wonder if we should have a flatten_list/1 and flatten_data/1 which would combine flatten_list + flatten_map.

@nelsonic nelsonic added enhancement New feature or request help wanted Extra attention is needed question Further information is requested technical A technical issue that requires understanding of the code, infrastructure or dependencies labels Oct 9, 2020
@nelsonic
Copy link
Member

nelsonic commented Oct 9, 2020

@vrcca great question. Both of these seem like valid use-cases we want to address. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested technical A technical issue that requires understanding of the code, infrastructure or dependencies
Projects
None yet
Development

No branches or pull requests

2 participants