Skip to content

Conversation

aapsi
Copy link
Contributor

@aapsi aapsi commented Jun 16, 2025

Summary

  • Main Change:
    Added address validation and formatting to the address book command.

Explanation of Changes:

  • Imported a new helper function, validateAndFormatAddress, from ../utils/index.js.
  • When adding or updating an address in the address book, the code now:
    • Calls validateAndFormatAddress on the input address.
    • If the address is invalid (the function returns a falsy value), the command exits early without saving the address.
    • Only a valid, formatted address is saved to the address book under the given label.
  • This validation logic was added both when adding a new address and updating an existing one.

Impact:
This change improves the reliability of the address book by ensuring that only properly validated and formatted addresses are stored, reducing potential errors from invalid addresses.

Changes:
image

image

image

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.

1 participant