dwyl / dwyl/useful

flatten_map/1 does not flatten lists

Open
#5 1 comment 2 reactions 0 assignees View on GitHub
enhancement help wanted question technical
Dominant language
Elixir
Stars
36
Forks
6
PR merge metrics
No merged PRs in 30d

Description

Given the following structure:
```elixir
%{items: [%{id: 1}, %{id: 2}], another: %{key: :value}}
```

I would expect the following result:
```elixir
%{another__key: :value, items__0__id: 1, items__1__id: 2}
```

But we actually get:
```elixir
%{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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.