Skip to content

fix: apply single nested subdoc getter results #47

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

Merged
merged 3 commits into from
May 12, 2025
Merged

Conversation

vkarpov15
Copy link
Member

Summary

Fixed #45: I think there was some confusion in #43 caused by the if statement being on the same line in L120.

Examples

@vkarpov15 vkarpov15 requested a review from Copilot May 12, 2025 20:02
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses the issue with applying single nested subdocument getters by updating the control flow in index.js and adding targeted tests.

  • Adjusts the if/else control structure to separate getter application and document field setting
  • Adds a new test case for verifying the behavior with single nested subdocs

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
test/index.test.js Added a test to validate the single nested subdocument getters fix
index.js Updated control flow to apply getters and set document fields accordingly
Comments suppressed due to low confidence (1)

index.js:120

  • The unconditional call to mpath.set after applying getters on single nested subdocs may override transformations from applyGettersToDoc. Please verify if this behavior is intended, or adjust the control flow to conditionally call mpath.set where appropriate.
else if (val && typeof val === 'object' && schematype.$isSingleNested) {

@vkarpov15 vkarpov15 merged commit 22171d0 into master May 12, 2025
6 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-45 branch May 12, 2025 20:12
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.

Getter doesn't work on a nested single subdocument
1 participant