flatten_unflatten 0.0.1 copy "flatten_unflatten: ^0.0.1" to clipboard
flatten_unflatten: ^0.0.1 copied to clipboard

A zero-dependency flatten and unflatten library for maps and lists

flatten_unflatten is a zero-dependency flatten and unflatten implementations for maps and lists

dart

Usage #

import 'package:flatten_unflatten/flatten_unflatten.dart';

void main() {
  final flattener = new Flatten();

  var flattened = flattener.flat({
    'a': {
      'b': {
        'c': ['hello', 'world']
      }
    }
  });
  print(flattened); // prints {a.b.c[0]: hello, a.b.c[1]: world}

  var unflattened = flattener.unflat({
    'a.b.c[0]': 'hello', 'a.b.c[1]': 'world',
  });
  print(unflattened); // prints {a: {b: {c: [hello, world]}}}
}
3
likes
130
pub points
68%
popularity

Publisher

unverified uploader

A zero-dependency flatten and unflatten library for maps and lists

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on flatten_unflatten