Moved phone number and email validation functions to appropriate folders#17
Open
ShrutiShahi18 wants to merge 1 commit intoisonnymichael:masterfrom
Open
Moved phone number and email validation functions to appropriate folders#17ShrutiShahi18 wants to merge 1 commit intoisonnymichael:masterfrom
ShrutiShahi18 wants to merge 1 commit intoisonnymichael:masterfrom
Conversation
Author
|
@isonnymichael please review the changes and merge if you find this helpful. |
Owner
|
hi @ShrutiShahi18 I have request changes:
I will close this PR later if you understand. Feel free to ask any questions or share issues here: #15 |
Owner
|
hello @ShrutiShahi18 are you still working on it? |
Author
|
@isonnymichael not anymore, I was facing lots of issues issues while creating a new branch. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes
Closes #4
✨ Changes Proposed
This PR implements the enhancement to move validation functions into separate modules for better organization, readability, and maintainability.
✅ Key Updates:
📦 Moved validateEmail from src/index.js to src/validators/email.js
📦 Moved validatePhoneNumber from src/index.js to src/validators/phone.js
🔗 Updated src/validators/index.js to export both functions
🔄 Refactored src/index.js to import validation functions from the new files
🧹 Removed inline validation logic from the main file to ensure separation of concerns
🔍 Benefits
Better Code Structure: Each validator is now in its own file
Improved Maintainability: Easier to update or modify individual validators
Testability: Validators can be tested independently
Scalability: New validators can be added without cluttering the main file
No Breaking Changes: The API remains the same for existing users
🛠 Technical Details
JSDoc comments have been preserved for both functions
ES6 modules (export/import) are used for clarity and tree-shaking
Validation logic remains unchanged; only moved for structural improvements
✅ Checklist
Code follows the project’s style guide
Changes are purely organizational (no breaking changes)
Functions are properly exported/imported
All existing tests pass
Documentation is up to date
Branch name follows the issue pattern (issue-4)
📝 Notes to Reviewers
This PR addresses the enhancement described in #4 by restructuring the validation logic. No functionality has been changed — only the location and organization of the code. Let me know if any adjustments are needed.
Thank you for reviewing! 🙌