deepie-merge
TypeScript icon, indicating that this package has built-in type declarations

1.3.2 • Public • Published

deepie-merge

Yay, another deep merge

Usage

npm i deepie-merge
import {deepMerge} from "deepie-merge";

deepMerge({a: [1]}, {a: [2]});
// => {a: [2]}

deepMerge({a: [1]}, {a: [2]}, {arrayExtend: true});
// => {a: [1, 2]}

deepMerge({a: [1], b: [1]}, {a: [2], b: [2]}, {arrayExtend: ["a"]});
// => {a: [1, 2], b: [2]}

API

deepMerge(dst, src, options)

  • dst any: Destination value
  • src any: Source value
  • options object:
    • arrayExtend boolean or string[]: Whether to extend arrays instead of replacing them. When passed a string array, it will only extend the object keys provided in that array.
    • maxRecursions number: Amount of nesting levels to recurse into. Default: 10

© silverwind, distributed under BSD licence

Readme

Keywords

none

Package Sidebar

Install

npm i deepie-merge

Weekly Downloads

200

Version

1.3.2

License

BSD-2-Clause

Unpacked Size

5.59 kB

Total Files

6

Last publish

Collaborators

  • silverwind