-
-
Save dbani-dev/5fb2364cc45d5a320e07671fd46a6fe8 to your computer and use it in GitHub Desktop.
Deep merge of JSON-like objects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const merge = (() => { | |
const duplicate = object => JSON.parse(JSON.stringify(object)); | |
return (...objects) => Object.assign(...objects.map(duplicate)); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment