Closed ZLY201 closed 1 year ago
This library can't merge non-basic objects out of the box. See https://github.com/TehShrike/deepmerge#ismergeableobject
I found this in the source code:
function getKeys(target) {
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
}
and something will be wrong with Object.keys
Object.keys(controller.signal) // []
but for...in works fine
for (const key in controller.signal) {
console.log(key);
}
/*
aborted
reason
onabort
throwIfAborted
addEventListener
dispatchEvent
removeEventListener
*/
May be should change to use for...in?
There are a few reason why for..in
is a bad approach so I don't see that changing.
If you want a more modern version of this library, check out https://github.com/RebeccaStevens/deepmerge-ts
An error occuren when merge axios config:
You can reproduce it with the following code:
Is this a bug?