tree-to-flat-map
v1.0.1
Published
Convert a tree to a flat map with dot-separated keys
Downloads
7,338
Maintainers
Readme
tree-to-flat-map
converts a tree to a flat map with dot-separated keys.
import { treeToFlatMap } from "tree-to-flat-map";
console.log(
treeToFlatMap(
{
a: {
b: {
c: true,
},
},
d: {
e: 1,
},
f: "leaf",
},
{ separator: "." }
)
);
// {"a.b.c": true, "d.e": 1, "f": "leaf"}