Skip to Content
  • Website
Codsen
  • Home
  • Open Source
  • Articles
  • About

backOpen Source→object-merge-advanced→Examples

Permalink to Table of ContentsTable of Contents

  • Quick Take
  • Override a merge result in the callback
  • Deduplicate and sort merged string arrays
  • Clear an array merge when either array contains strings
  • Concatenate every clashing pair of arrays
  • Concatenate arrays on a selected key
  • Prefer incoming values for every clash
  • Take the incoming value for a selected clashing key
  • Keep existing values for every clash
  • Merge array values and omit duplicates instead of concatenating positions
  • Merge Boolean clashes with AND instead of the default OR
  • Merge positioned array objects even when their key sets differ
  • Let null explicitly override another value
  • Apply one array object to every object in the other array
  • Reuse caller-owned inputs instead of defensively cloning them
↑ back to top

Permalink to Quick TakeQuick Take

↑ back to top

Permalink to Override a merge result in the callbackOverride a merge result in the callback

↑ back to top

Permalink to Deduplicate and sort merged string arraysDeduplicate and sort merged string arrays

↑ back to top

Permalink to Clear an array merge when either array contains stringsClear an array merge when either array contains strings

↑ back to top

Permalink to Concatenate every clashing pair of arraysConcatenate every clashing pair of arrays

↑ back to top

Permalink to Concatenate arrays on a selected keyConcatenate arrays on a selected key

↑ back to top

Permalink to Prefer incoming values for every clashPrefer incoming values for every clash

↑ back to top

Permalink to Take the incoming value for a selected clashing keyTake the incoming value for a selected clashing key

↑ back to top

Permalink to Keep existing values for every clashKeep existing values for every clash

↑ back to top

Permalink to Merge array values and omit duplicates instead of concatenating positionsMerge array values and omit duplicates instead of concatenating positions

↑ back to top

Permalink to Merge Boolean clashes with AND instead of the default ORMerge Boolean clashes with AND instead of the default OR

↑ back to top

Permalink to Merge positioned array objects even when their key sets differMerge positioned array objects even when their key sets differ

↑ back to top

Permalink to Let null explicitly override another valueLet null explicitly override another value

↑ back to top

Permalink to Apply one array object to every object in the other arrayApply one array object to every object in the other array

↑ back to top

Permalink to Reuse caller-owned inputs instead of defensively cloning themReuse caller-owned inputs instead of defensively cloning them

↑ back to top
back 

Copyright

All rights reserved © Roy Revelt 2026
All our open source packages are under MIT licenceopens in a new tab

Activities

🐛 See a bug? Raise an issueopens in a new tab
💘 Check out the Indiewebopens in a new tab and Libera manifestoopens in a new tab