Record-like deep assign
Recursively assigns enumerable own properties of the given sources to a target object.
-
API inspired by
Object.assign
, with source objects applied from left to right:// Returns `target` -
Plain objects are merged deeply:
// Result: { x: { a: 1, b: 2 } } -
Arrays and constructor-instantiated objects are treated like primitives. They aren't merged but replaced in their entirely:
// Result: { arr: ["c"] }// Result: { x: Date 1997-11-21 } -
Nullish sources are ignored:
// Result: { a: 1, b: 2 }
Contributors
Thanks goes to these wonderful people (emoji key):
Kristóf Poduszló 🚧 💻 📖 ⚠️ 🤔 🚇 |
Pierre-Antoine Mills 🤔 |