dset is a minimalist JavaScript utility, currently at version 3.1.4, designed for safely setting deeply nested values within objects. It distinguishes itself by its extremely small footprint (under 200 bytes gzipped for the main module) and explicit protection against prototype pollution since v2.1.0. The package has a stable release cadence with frequent patch updates and less frequent minor/major releases. A key differentiator is the `dset/merge` submodule, introduced in v3.1.0, which provides a merging behavior for deep object writes, useful for scenarios like GraphQL stream directives, contrasting with the main `dset` module's default overwrite behavior. It ships with TypeScript definitions, making it well-suited for modern JavaScript and TypeScript projects.
npm install dsetVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of `dset` to create new deep paths, overwrite non-object values (v3+), update array elements, and initialize arrays.
Review existing code for instances where `dset` targeted paths that might contain non-object values, as their structure will now be implicitly converted to an object to accommodate the new path.
Update import statements from `import dset from 'dset';` to `import { dset } from 'dset';`.Upgrade `dset` to version `2.1.0` or higher immediately to ensure protection against prototype pollution attacks.
Choose the appropriate module (`dset` or `dset/merge`) based on whether you intend to replace or merge values at deep paths. Be explicit with your imports to avoid confusion.
Change your import statement from `import dset from 'dset';` to `import { dset } from 'dset';`.Ensure your `tsconfig.json` (for TypeScript) and bundler configuration (`webpack.config.js`, `vite.config.js`, etc.) are up-to-date and correctly configured for modern module resolution, e.g., using `"moduleResolution": "bundler"` or `"nodenext"` in TypeScript.
Avoid using `__proto__`, `constructor`, or `prototype` as path segments for security reasons. Ensure your `dset` version is `2.1.0` or higher to benefit from built-in prototype pollution guards.
No dependency data recorded yet.