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

Fix the oldArrayMerge example #84

Merged
merged 3 commits into from
Nov 1, 2017
Merged

Fix the oldArrayMerge example #84

merged 3 commits into from
Nov 1, 2017

Conversation

TehShrike
Copy link
Owner

Fixes #83

@TehShrike
Copy link
Owner Author

https://github.com/KyleAMathews/deepmerge/pull/84/files#diff-0730bb7c2e8f9ea2438b52e419dd86c9R146

jsmd will check this assertion to make sure the example actually works.

@TehShrike
Copy link
Owner Author

Look reasonable?

@matatk

@matatk
Copy link

matatk commented Nov 1, 2017

Thanks for the really quick turnaround on this.

Have tried it and, I'm not sure why, but it's not producing the same results that 1.5.2 was for me. I'm currently unsure as to exactly what the root of the problem is, but one thing it's definitely doing is turning a string into an object of (letter index, letter) pairs.

e.g. [..., 'hello', ...] has become [..., {0: 'h', 1: 'e', 2: 'l', 3: 'l', 4: 'o'}, ...].

I was also wondering: given that deepmerge already uses is-mergeable-object, would it be possible for deepmerge to expose it so that I don't then need to add is-mergeable-object as an extra dependency?

@TehShrike
Copy link
Owner Author

mm, I'll bet that's due to clone defaulting to true now. If you pass in { clone: true } to 1.5.2, do you get the same string-spreading behavior?

@TehShrike
Copy link
Owner Author

ah nope, I mis-transcribed the clone function. It shouldn't try to clone if the input isn't a mergeable object.

@TehShrike
Copy link
Owner Author

I was also wondering: given that deepmerge already uses is-mergeable-object, would it be possible for deepmerge to expose it so that I don't then need to add is-mergeable-object as an extra dependency?

I made an issue #85 for that.

matatk added a commit to matatk/landmarks that referenced this pull request Nov 1, 2017
@matatk
Copy link

matatk commented Nov 1, 2017

It's working fine now; thanks again, particularly for fixing this so quickly.

@TehShrike TehShrike merged commit 18fd679 into TehShrike:master Nov 1, 2017
@TehShrike
Copy link
Owner Author

Published as 2.0.1

matatk added a commit to matatk/landmarks that referenced this pull request Nov 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants