|
|
|
|
|
by hnben
1016 days ago
|
|
I don't like how it could result in surprises. e.g. you use it to update an array, but there are objects inside, which you accidentally modify. I think these surprises could be reduced if you turn them into explicit parameters in the signature, e.g. export const updateWhere = (whereFn, updatefn, thing, recurseArray=true , recurseObjects=true)
|
|
Also any non-enumerable properties that may have been defined on objects are lost.
Basically the function is only suitable for recently parsed JSON.