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

Map to Map/List conversion #248

Open
zhqu1148980644 opened this issue Oct 14, 2022 · 1 comment
Open

Map to Map/List conversion #248

zhqu1148980644 opened this issue Oct 14, 2022 · 1 comment

Comments

@zhqu1148980644
Copy link

zhqu1148980644 commented Oct 14, 2022

The spec says map/filter macro only support list type, how to apply map/filter macros to map, so we can transform a map to another map or list.

expected use case:

  1. map to list
{
  "k1": "v1",
  "k2": "v2"
}.map({k, v}, {k: v})

==>

[
 {"k1": "v1"},
 {"k2": "v2"}
]
  1. list to map
map([
["k1", "v1"],
["k2": "v2"]
])

==>
{
  "k1": "v1",
  "k2": "v2"
}

@zhqu1148980644 zhqu1148980644 changed the title Map to Map//List conversion Map to Map/List conversion Oct 14, 2022
@matthchr
Copy link

I'm also curious about this.

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

3 participants
@matthchr @zhqu1148980644 and others