Skip to content

Moved phone number and email validation functions to appropriate folders#17

Open
ShrutiShahi18 wants to merge 1 commit intoisonnymichael:masterfrom
ShrutiShahi18:master
Open

Moved phone number and email validation functions to appropriate folders#17
ShrutiShahi18 wants to merge 1 commit intoisonnymichael:masterfrom
ShrutiShahi18:master

Conversation

@ShrutiShahi18
Copy link
Copy Markdown

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! 🙌

@ShrutiShahi18
Copy link
Copy Markdown
Author

@isonnymichael please review the changes and merge if you find this helpful.

@isonnymichael isonnymichael self-requested a review July 7, 2025 10:34
@isonnymichael
Copy link
Copy Markdown
Owner

isonnymichael commented Jul 7, 2025

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

@isonnymichael
Copy link
Copy Markdown
Owner

hello @ShrutiShahi18 are you still working on it?

@ShrutiShahi18
Copy link
Copy Markdown
Author

@isonnymichael not anymore, I was facing lots of issues issues while creating a new branch.

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.

🔧 [ENHANCEMENT] - Move validateEmail function to validators/email.js

2 participants