map2tree is a utility library that provides a pure function to convert a flat map structure into a hierarchical tree. Its primary use case is within the `redux-devtools-chart-monitor` package, influencing its specific opinions on how data is transformed. It does not convert objects and arrays deeply nested within collections into tree structures and offers support for Immutable.js List and Map data types. The current stable version, 4.0.0, was released as an ESM-only package. The library is part of the `reduxjs/redux-devtools` monorepo, suggesting its release cadence is tied to the broader Redux DevTools ecosystem.
npm install map2treeVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import and use `map2tree` with a sample map, specifying root key and child order, and logs the resulting tree structure.
Migrate your project to use ES modules (e.g., set `"type": "module"` in `package.json`) and use `import` statements, or transpile your code with a bundler like Webpack or Rollup that supports ESM.
Be aware of this specific behavior. If full deep recursion for all nested structures is required, `map2tree` may not be suitable without pre-processing or a different utility.
Ensure you are only using Immutable.js `List` and `Map` if you expect them to be transformed. For other Immutable.js types, convert them to plain JavaScript objects or arrays before passing them to `map2tree` if you need them included in the tree.
Update your import statement to `import map2tree from 'map2tree';` and ensure your project or bundler is configured for ES modules.
Use the correct default import: `import map2tree from 'map2tree';` or verify that your CommonJS `require()` is being transpiled correctly if using an older version that supported it.
No dependency data recorded yet.