# deepmerge-concat

> deepmerge with added concat function for devour queries

Latest version **1.1.2** (published 2019-11-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install deepmerge-concat
pnpm add deepmerge-concat
yarn add deepmerge-concat
bun add deepmerge-concat
```

## 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.1.2 |
| Published | 2019-11-25 |
| First published | 2019-05-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 9.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Gordon Farquharson |
| Maintainers | godronus |

## Links

- npm: https://www.npmjs.com/package/deepmerge-concat
- Repository: https://github.com/godronus/deepmerge-concat
- Homepage: https://github.com/godronus/deepmerge-concat#readme
- Issues: https://github.com/godronus/deepmerge-concat/issues
- npm.io page: https://npm.io/package/deepmerge-concat

## Dependencies (1)

- [deepmerge](https://npm.io/package/deepmerge.md) ^4.2.2

## Recent versions

- 1.1.2 (latest) — 2019-11-25
- 1.1.1 — 2019-05-30
- 1.1.0 — 2019-05-30
- 1.0.16 — 2019-05-29
- 1.0.15 — 2019-05-29
- 1.0.14 — 2019-05-29
- 1.0.13 — 2019-05-29
- 1.0.12 — 2019-05-29
- 1.0.11 — 2019-05-29
- 1.0.10 — 2019-05-29
- 1.0.9 — 2019-05-29
- 1.0.8 — 2019-05-29
- 1.0.7 — 2019-05-29
- 1.0.6 — 2019-05-29
- 1.0.5 — 2019-05-29
- … 5 more at https://npm.io/package/deepmerge-concat/versions

## README

This package is an extension of `deepmerge`

Adds capability to concat strings and arrays whilst merging two objects


**USAGE:**

First import package into project

`npm install deepmerge-concat --save`

Example:

```
const deepmerge = require('deepmerge-concat');

const obj1 = {
  include: 'one,two,three',
  fields: 'one,two,three',
  sort: {
    test: 'one,two,three',
    arr: ['one', 'two', 'three']
  },
  help: false
};

const obj2 = {
  include: 'four,five',
  fields: 'four,five',
  sort: {
    test: 'four,five',
    arr: ['four', 'five'],
  },
  help: true
};

deepmerge.concat(obj1, obj2);

```

Result:

```
{
  "include": "one,two,three,four,five",
  "fields": "one,two,three,four,five",
  "sort": {
    "test": "one,two,three,four,five",
    "arr": ["one","two","three","four","five"]
  },
  "help": true
}

```

As you can see this concats and string/array values found within the nested objects.

Other primitives (e.g. numbers/bools) are still overwritten as per deepmerge functionality.

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