You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We often need to merge deep options where there is usually a base/initial set of defaults that are then overridden by the input. I think this is a pretty common usecase for property-sheets/configurations.
Historically we've had lodash handy and have leaned on lodash.merge for that, but we started trying to move away from it. Recently we went tested out a whole collection of different util libs including radash, but found the merge functionality in most of them to be different to what "we" expected. We ended up choosing to use deepmerge-ts for this specific function in the end (as it was customizable).
I just stumbled across es-toolkit and played with your merge function, I noted that when merging arrays the strategy seems to be index replacement. Is there anyway to change/customize this? In the usecase described above, typically the expectation would be whole array replacement when present, skip when undefined.
If not, is this something you would consider adding, or is there perhaps another more appropriate function that I might have overlooked?
The text was updated successfully, but these errors were encountered:
We often need to merge deep
options
where there is usually a base/initial set of defaults that are then overridden by the input. I think this is a pretty common usecase for property-sheets/configurations.Historically we've had
lodash
handy and have leaned onlodash.merge
for that, but we started trying to move away from it. Recently we went tested out a whole collection of different util libs includingradash
, but found the merge functionality in most of them to be different to what "we" expected. We ended up choosing to usedeepmerge-ts
for this specific function in the end (as it was customizable).I just stumbled across
es-toolkit
and played with yourmerge
function, I noted that when merging arrays the strategy seems to be index replacement. Is there anyway to change/customize this? In the usecase described above, typically the expectation would be whole array replacement when present, skip whenundefined
.If not, is this something you would consider adding, or is there perhaps another more appropriate function that I might have overlooked?
The text was updated successfully, but these errors were encountered: