About this project
dot-path-value provides getByPath, setByPath, and hasByPath functions to interact with deep nested object properties using dot notation. Designed as a TypeScript-first library, it ensures type safety by constraining valid paths and inferring value types at compile time. It supports arrays and tuples, and automatically creates missing intermediate objects or arrays during assignment. The library is tiny, dependency-free, and supports both ESM and CJS. It also exports utility types such as Path, PathValue, and ArrayPath for advanced type manipulation in generic functions. Security features include throwing TypeError for paths containing __proto__, constructor, or prototype, and preventing writes to inherited properties to avoid prototype pollution.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.