Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use latest deepmerge convenience functions #324

Closed
matatk opened this issue Oct 8, 2019 · 0 comments · Fixed by #326
Closed

Use latest deepmerge convenience functions #324

matatk opened this issue Oct 8, 2019 · 0 comments · Fixed by #326
Assignees
Milestone

Comments

@matatk
Copy link
Owner

matatk commented Oct 8, 2019

The legacy array merge function should be updated to use the latest API provided by TehShrike/deepmerge#85.

Current Landmarks build script code:

landmarks/scripts/build.js

Lines 375 to 390 in 859c21b

function legacyArrayMerge(target, source, options) {
const destination = target.slice()
source.forEach(function(e, i) {
if (typeof destination[i] === 'undefined') {
const cloneRequested = options.clone !== false
const shouldClone = cloneRequested && options.isMergeableObject(e)
destination[i] = shouldClone ? clone(e, options) : e
} else if (options.isMergeableObject(e)) {
destination[i] = merge(target[i], e, options)
} else if (target.indexOf(e) === -1) {
destination.push(e)
}
})
return destination
}

This needs to match the reference code from deepmerge: arrayMerge example: combine arrays.

@matatk matatk added this to the 2.6.x milestone Oct 8, 2019
@matatk matatk self-assigned this Oct 8, 2019
matatk added a commit that referenced this issue Dec 15, 2019
This simplifies the "combine" array merging technique.

Fixes #324
matatk added a commit that referenced this issue Dec 15, 2019
This simplifies the "combine" array merging technique.

Fixes #324
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant