# @recursive/assign

> 💠 Recursive assign for objects, arrays and more

Latest version **3.0.1** (published 2024-04-12) · UNLICENSE license · 0 weekly downloads

## Install

```sh
npm install @recursive/assign
pnpm add @recursive/assign
yarn add @recursive/assign
bun add @recursive/assign
```

## Health

**Score 40/100 (D)** — status: abandoned.

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

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2024-04-12 |
| First published | 2018-11-01 |
| Weekly downloads | 0 |
| License | UNLICENSE |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 26.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 39 |
| Author | omrilotan |
| Maintainers | omrilotan |
| Keywords | 💠, deep, merge, extend, mixin, recursive, key, keys, object, array, function, set, map, properties, property, props, prop, values, value |

## Links

- npm: https://www.npmjs.com/package/@recursive/assign
- Repository: https://github.com/omrilotan/mono
- Homepage: https://omrilotan.com/mono/assign/
- Issues: https://github.com/omrilotan/mono/issues
- npm.io page: https://npm.io/package/@recursive/assign

## 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

- 3.0.1 (latest) — 2024-04-12
- 3.0.0 — 2024-03-12
- 2.0.2 — 2020-04-02
- 2.0.1 — 2020-04-02
- 2.0.0 — 2020-04-02
- 1.2.5 — 2019-07-30
- 1.2.4 — 2019-06-20
- 1.2.3 — 2018-11-08
- 1.2.2 — 2018-11-07
- 1.1.3 — 2018-11-06
- 1.1.2 — 2018-11-01

## README

# @recursive/assign [![](https://img.shields.io/npm/v/@recursive/assign.svg)](https://www.npmjs.com/package/@recursive/assign) [![](https://img.shields.io/badge/source--000000.svg?logo=github&style=social)](https://github.com/omrilotan/mono/tree/master/packages/assign) [![](https://badgen.net/bundlephobia/minzip/@recursive/assign)](https://bundlephobia.com/result?p=@recursive/assign)

💠 Recursive assign for objects, arrays and more

```ts
import { assign } from "@recursive/assign";

assign({ hash: { a: 1 } }, { hash: { b: 2, c: 0 } }, { hash: { c: 3 } }); // {hash: {a: 1, b:2, c: 3}}
```

I will merge:

- ✔ objects
- ✔ arrays
- ✔ functions
- ✔ sets
- ✔ maps

Array

```js
assign({ array: [1, 2, 3] }, { array: [3, 4] });
// {array: [3, 4, 3]}
```

Array of assignable members

```js
assign(
	[{ firstName: "Omri" }, { firstName: "Tom" }],
	[{ lastName: "Lotan" }, { lastName: "Ben Amitai" }],
);
// [{firstName: 'Omri', lastName: 'Lotan'}, {firstName: 'Tom', lastName: 'Ben Amitai'}]
```

Set

```js
assign({ set: new Set([1, 2]) }, { set: new Set([2, 3]) });
// {set: [1, 2, 3]}
```

Map

```js
assign(
	{map: new Map([[1, 2], [3, 4]])}
	{map: new Map([[1, 3], [4, 5]])}
);
// {map: [[1, 3], [3, 4], [4, 5]]}
```

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