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(core): properties with similar names map to undefined #601

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vbrzezina
Copy link

@vbrzezina vbrzezina commented Mar 11, 2024

As described in #527, in cases where there are two properties with same "suffix" (starting with the same part) like StartDate and StartDateTimeZone it is assumed that TimeZone is actually nested property that needs to be flattened resulting in the property being undefined in the result.

Where the shared suffix is being searched in source object, however, and that is my solution to the problem, it's not checked whether it's actually object and thus needs to be flattened. In the reference source object, primitive values are all undefined, but when there's nested objects, they're expanded as objects with their own properties. So this fix verifies, that the property to be flattened is an object.

I'm honestly wasn't sure if I should add it only at the two places I did or to just add it to the hasProperty function. I also didn't find any existing spec for getFlatteningPaths and as I'm not familiar with it in depth and don't know all the requirements, I'm not sure I'm up to writing all the other test cases..

Copy link

sonarcloud bot commented Mar 11, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@vbrzezina vbrzezina marked this pull request as ready for review March 11, 2024 18:28
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

1 participant