London | ITP-May-2025 | Sisay Mehari | Module-Data-Groups | Sprint 2 #583
+227
−26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Learners, PR Template
Self checklist
Changelist
✅ Completed Work Summary
This batch of commits includes several key improvements across object handling, function refactoring, string parsing, and utility implementations — all with input validation and test coverage.
🏠 Object Property Access & Iteration
Correctly access the houseNumber property from nested address objects.
Implemented reliable iteration over object property values for better data processing.
Fixed ingredient list logging to output correctly formatted arrays.
🔍 Utility Functions & Parsing
Added a contains function with thorough input validation and comprehensive tests.
Created createLookup function, converting arrays into lookup objects for faster access.
Improved query string parser to correctly handle multiple test cases.
📊 Counting & Frequency Functions
Implemented tally function that counts occurrences with proper parameter handling.
Refined the invert function with added tests and bug fixes for base cases.
Split calculateMode into smaller, focused functions to improve readability and maintainability.
💰 Coin Calculation Fixes
Fixed coin calculation logic by parsing coin keys safely and ignoring invalid entries.
Added tests to ensure robustness against unknown or malformed keys in input objects.
🕒 Recent Commits Highlights
Added a function to count words and return a frequency object with key-value pairs.
Completed breaking down calculateMode into smaller modular functions.
Fixed totalTill function to parse and sum coin values correctly, handling edge cases.
🧪 Testing
Full test coverage added for new and updated functions.
Tests cover edge cases, invalid inputs, and common usage scenarios to ensure reliability.
Questions
None at the moment.