A utility to transform object keys and values into a new object with deep recursion and symbol support.
Map-obj is a JavaScript library that transforms object keys and values into a new object using a custom mapping function. It solves the problem of manually iterating over objects to modify or filter their properties, offering features like deep recursion and symbol key support. It's particularly useful for data normalization, key renaming, and conditional property inclusion.
JavaScript developers who need to programmatically transform object structures, such as when processing API responses, configuring objects, or implementing data pipelines.
Developers choose map-obj for its concise API, robust handling of edge cases (like built-in objects and symbols), and flexibility in deep transformations without external dependencies.
Map object keys and values into a new object
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The mapper function allows swapping, modifying, or filtering keys and values, with the ability to skip entries using `mapObjectSkip`, enabling custom transformations.
With the `deep` option, it recursively transforms nested objects and arrays while automatically excluding built-in objects like Date and Map, preventing recursion issues.
Symbol keys can be included and transformed via the `includeSymbols` option, addressing an edge case often overlooked in similar utilities.
The API is concise with clear parameters and options, making it easy to integrate for specific object transformation tasks without bloat.
It lacks pre-defined mappers for common tasks like key casing changes, requiring users to write custom functions instead of using drop-in solutions.
While it handles nested objects and arrays in recursion, its primary focus is on objects, so it doesn't provide standalone utilities for array or other data structure transformations.
Deep recursion can be inefficient for large or complex objects, and there's no optimization for traversal methods, which might impact performance in data-intensive applications.