# just-safe-set

> set value at property, create intermediate properties if necessary

Latest version **4.2.1** (published 2023-02-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install just-safe-set
pnpm add just-safe-set
yarn add just-safe-set
bun add just-safe-set
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.2.1 |
| Published | 2023-02-04 |
| First published | 2016-08-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6200 |
| Author | Angus Croll |
| Maintainers | angus-c |
| Keywords | object, safe, set, no-dependencies, just |

## Links

- npm: https://www.npmjs.com/package/just-safe-set
- Repository: https://github.com/angus-c/just
- Homepage: https://github.com/angus-c/just#readme
- Issues: https://github.com/angus-c/just/issues
- npm.io page: https://npm.io/package/just-safe-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

- 4.2.1 (latest) — 2023-02-04
- 4.2.0 — 2022-12-17
- 4.1.1 — 2022-08-08
- 4.1.0 — 2022-08-07
- 4.0.2 — 2022-01-09
- 4.0.1 — 2021-11-13
- 4.0.0 — 2021-11-09
- 3.1.1 — 2021-11-01
- 3.1.0 — 2021-10-31
- 3.0.0 — 2021-10-22
- 2.2.3 — 2021-08-30
- 2.2.2 — 2021-06-23
- 2.2.1 — 2021-04-04
- 2.2.0 — 2021-04-04
- 2.1.0 — 2018-08-09
- … 4 more at https://npm.io/package/just-safe-set/versions

## README

<!-- DO NOT EDIT THIS FILE! THIS FILE WAS AUTOGENERATED BY TEMPLATE-MATE -->
<!-- SEE https://github.com/angus-c/just/blob/master/CONTRIBUTING.md#readme-template -->

## just-safe-set

Part of a [library](https://anguscroll.com/just) of zero-dependency npm modules that do just do one thing.
Guilt-free utilities for every occasion.

[`🍦 Try it`](https://anguscroll.com/just/just-safe-set)

```shell
npm install just-safe-set
```
```shell
yarn add just-safe-set
```

Set value at property, create intermediate properties if necessary

```js
import set from 'just-safe-set';

const obj1 = {};
set(obj1, 'a.aa.aaa', 4); // true
obj1; // {a: {aa: {aaa: 4}}}

const obj2 = {};
set(obj2, ['a', 'aa', 'aaa'], 4); // true
obj2; // {a: {aa: {aaa: 4}}}

const obj3 = {a: {aa: {aaa: 2}}};
set(obj3, 'a.aa.aaa', 3); // true
obj3; // {a: {aa: {aaa: 3}}}

const obj5 = {a: {}};
const sym = Symbol();
set(obj5.a, sym, 7); // true
obj5; // {a: {Symbol(): 7}}
```

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