# assign-set

> [![](https://img.shields.io/npm/dw/assign-set?style=flat-square)](https://www.npmjs.com/package/assign-set)

Latest version **1.1.9** (published 2025-06-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install assign-set
pnpm add assign-set
yarn add assign-set
bun add assign-set
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

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

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.9 |
| Published | 2025-06-16 |
| First published | 2022-06-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 27.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | noyobo |

## Links

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

## Recent versions

- 1.1.9 (latest) — 2025-06-16
- 1.1.8 — 2024-09-10
- 1.1.7 — 2024-09-10
- 1.1.6 — 2024-01-18
- 1.1.5 — 2022-06-14
- 1.1.4 — 2022-06-13
- 1.1.3 — 2022-06-13
- 1.1.2 — 2022-06-13
- 1.1.1 — 2022-06-09
- 1.1.0 — 2022-06-08
- 1.0.0 — 2022-06-08

## README

# assign-set

[![](https://img.shields.io/npm/dw/assign-set?style=flat-square)](https://www.npmjs.com/package/assign-set)

Base on lodash.set, But the difference between Array and Array-like object

```js
const assignSet = require('assign-set');

assignSet(obj, 'a.2.c', 'value');
obj = { a: { 2: { c: 'value' } } };

assignSet(obj, 'a[2].c', 'value');
obj = { a: [undefined, undefined, { c: 'value' }] };
```

The difference of `lodash.set`

```js
const lodash = require('lodash.set');

assignSet(obj, 'a.2.c', 'value');
obj = { a: [undefined, undefined, { c: 'value' }] };

assignSet(obj, 'a[2].c', 'value');
obj = { a: [undefined, undefined, { c: 'value' }] };
```

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