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 #320 #321

Merged
merged 2 commits into from
Oct 19, 2021
Merged

fix #320 #321

merged 2 commits into from
Oct 19, 2021

Conversation

jjkavalam
Copy link
Contributor

Copy link
Owner

@eemeli eemeli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this seems valid. I got originally sidetracked by the examples here only including alias nodes or a sequence thereof as the value, but this should resolve the final issues with this.

One minor nitpick in the code that would be nice to resolve before merging.

@@ -16,6 +16,7 @@ export function addPairToJSMap(
{ key, value }: Pair
) {
if (ctx && ctx.doc.schema.merge && isMergeKey(key)) {
value = ctx && isAlias(value) ? value.resolve(ctx.doc) : value
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
value = ctx && isAlias(value) ? value.resolve(ctx.doc) : value
value = isAlias(value) ? value.resolve(ctx.doc) : value

The previous line will check for ctx, so no need to do so here again. It looks like mergeToJSMap is also never called with an undefined ctx, so the checks there ought to be removed as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eemeli Thank you for taking the time. I have incorporated the suggestion as well as added a test. If all ok, will be happy to see this merged. Also when is this fix likely to be released ?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll see about getting a new release out later this week. Got no strict schedule for that.

@eemeli eemeli merged commit daaa5b4 into eemeli:master Oct 19, 2021
Nathan-Fenner pushed a commit to Nathan-Fenner/yaml that referenced this pull request Nov 17, 2021
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.

Add support for "value associated with the merge key is a sequence"
2 participants