# fast-path-set

> A fast drop-in replacement for lodash.set

Latest version **1.0.1** (published 2021-04-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install fast-path-set
pnpm add fast-path-set
yarn add fast-path-set
bun add fast-path-set
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-04-27 |
| First published | 2021-04-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Maintainers | galvez |

## Links

- npm: https://www.npmjs.com/package/fast-path-set
- Repository: https://github.com/galvez/fast-path-set
- Issues: https://github.com/galvez/fast-path-set/issues
- npm.io page: https://npm.io/package/fast-path-set

## Recent versions

- 1.0.1 (latest) — 2021-04-27
- 1.0.0 — 2021-04-26
- 0.0.5 — 2021-04-26
- 0.0.4 — 2021-04-25
- 0.0.3 — 2021-04-25
- 0.0.2 — 2021-04-24
- 0.0.1 — 2021-04-24

## README

# fast-path-set

A fast drop-in replacement for [`lodash.set`](https://www.npmjs.com/package/lodash.set).

## Install 

```
$ npm i fast-path-set --save
```

## Usage

```js
const set = require('fast-path-set')
const obj = {}
set(obj, 'a.b.c', 1)
console.log(obj.a.b.c)
```

Check [`test.js`](https://github.com/galvez/fast-path-set/blob/main/test.js) for more detailed usage examples. There is one **key** difference to `lodash.set`, which is the fact `fast-path-set` will **prioritise safety** and abort attempts to overwrite non-object values. It also correctly prevents prototype pollution attacks.

## Benchmark

```
$ npm i lodash.set
$ node bench.js lodash.set
85422.0864751339
$ npm i dset
$ node bench.js dset
65307.5742549896
$ node bench.js fast-path-set
63214.1385409832
```

## Acknowledgements

Thanks to
[Luke Edwards](https://github.com/lukeed),
[James M Snell](https://github.com/jasnell) and
[Simone Sanfratello](https://github.com/simone-sanfratello)
for helping polishing this to perfection.

## License

MIT

---
_Source: https://npm.io/package/fast-path-set · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
