FaasJS
Home
  • Guide
  • Documents
  • Starter Template
  • Changelog
  • Ecosystem

    • VS Code Plugin
    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security
  • English
  • 简体中文
Home
  • Guide
  • Documents
  • Starter Template
  • Changelog
  • Ecosystem

    • VS Code Plugin
    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security
  • English
  • 简体中文

Documents / @faasjs/deep_merge / deepMerge

Function: deepMerge()

deepMerge(...sources): any

Deep merge two objects or arrays.

Features:

  • All objects will be cloned before merging.
  • Merging order is from right to left.
  • If an array include same objects, it will be unique to one.
deepMerge({ a: 1 }, { a: 2 }) // { a: 2 }
deepMerge([1, 2], [2, 3]) // [1, 2, 3]

Parameters

sources

...any[]

Returns

any