-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PLU-393: Variables: keys with . may be single key or nested path (#831)
### TL;DR New MyInfo Child fields from FormSG returns data with `.` as part of the key (e.g., `child.birthdate`). Libraries like `lodash.get` treat `.` as a path separator for nested properties (e.g., accessing `child.birthdate`), leading to incorrect value retrieval or failure. ### What changed? - Replaced the `.` in keys with `_` to avoid issues with obtaining values. ### How to test? 1. Run the test suite to verify all scenarios pass 2. Test with actual FormSG fields from MyInfo Child ### Why make this change? The standard lodash.get function doesn't properly handle cases where object keys contain dots, leading to incorrect property access. This implementation provides more accurate property resolution.
- Loading branch information
1 parent
35f179f
commit d3b6611
Showing
3 changed files
with
125 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters