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 and unflatten JSON #14

Open
vincevargadev opened this issue Sep 22, 2023 · 1 comment
Open

Flatten and unflatten JSON #14

vincevargadev opened this issue Sep 22, 2023 · 1 comment

Comments

@vincevargadev
Copy link
Member

vincevargadev commented Sep 22, 2023

void main() {
  final m = {
    'int': 1,
    'str': 'a',
    'map': {
      'b': 2,
      'c': 3,
    },
    'list': [4, 5, 6]
  };
  
  // MAGIC!
  
  final result = {
    'int': 1,
    'str': 'a',
    'map.b': 2,
    'map.c': 3,
    'list[0]': 4,
    'list[1]': 5,
    'list[2]': 6,
  };
}
@vincevargadev
Copy link
Member Author

Flatten is probably a good name:

@vincevargadev vincevargadev changed the title JSON flatten? Flatten and unflatten JSON Sep 25, 2023
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

1 participant