# deep-property-set

> Deep set js object properties based on property name, in any deepness level

Latest version **1.0.2** (published 2020-05-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install deep-property-set
pnpm add deep-property-set
yarn add deep-property-set
bun add deep-property-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.2 |
| Published | 2020-05-01 |
| First published | 2020-05-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | andrefa |
| Maintainers | andrefa |
| Keywords | object, property, set |

## Links

- npm: https://www.npmjs.com/package/deep-property-set
- npm.io page: https://npm.io/package/deep-property-set

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2020-05-01
- 1.0.1 — 2020-05-01
- 1.0.0 — 2020-05-01

## README

<h1 align="center">Welcome to deep-property-set 👋</h1>
<p>
  <a href="https://github.com/andrefa/deep-property-set#readme" target="_blank">
    <img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" />
  </a>
  <a href="https://github.com/andrefa/deep-property-set/graphs/commit-activity" target="_blank">
    <img alt="Maintenance" src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" />
  </a>
</p>

> Utility function responsible to replace properties on nested objects, without prior knowledge of object structure.

## Install

```sh
npm install deep-property-set
```

## Usage

```js
const deepSet = require('deep-property-set').deepSet

// The source object to be modified
const obj = {
    a: 1,
    b: 2,
    c: {
        d: 3,
        b: 4
    }
};
// The name of the property which will be replaced
const property = 'b';
// The new value for the property aforementioned
const replacement = 'new-value';

// A new object with the mentioned property modified to the new value
const result = deepSet(obj, property, replacement);

result = {
    a: 1,
    b: 'new-value',
    c: {
        d: 3,
        b: 'new-value'
    }
};
```
Where

`object` - the source object
## Author

👤 **Andre Almeida**

* Github: [@andrefa](https://github.com/andrefa)

## 🤝 Contributing

Contributions, issues and feature requests are welcome!<br />Feel free to check [issues page](https://github.com/andrefa/deep-property-set/issues).

## Show your support

Give a ⭐️ if this project helped you!

## 📝 License

Copyright © 2020 [Andre Almeida](https://github.com/andrefa).
This project is [MIT](https://github.com/andrefa/deep-property-set/blob/master/LICENSE) licensed.

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