tree-to-flat-map
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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"}

Package Sidebar

Install

npm i tree-to-flat-map

Weekly Downloads

1,988

Version

1.0.1

License

MIT

Unpacked Size

12.4 kB

Total Files

11

Last publish

Collaborators

  • tibdex