flatten_unflatten 0.0.1 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
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]}}}
}