-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added feature and test for zipcode validation #26
Conversation
src/utils/isValidZipCode.js
Outdated
* @returns {Boolean} | ||
*/ | ||
const isValidZipCode = (code) => | ||
Number.isInteger(code) && code >= 1000 && code <= ZIP_COUNT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your point in #24 is valid IMO, we can pass a string like '01027'
, so I'd suggest either just checking if code is not NaN
(with Number.isNaN), or you use parseInt(code)
then you check for parsedCode >= 1000 && parsedCode <= ZIP_COUNT;
What should I do? I'm new to open source. |
You can help us here by reviewing the code, and suggest any improvements. But first, we should wait for the PR author to publish the latest changes and then when the review is requested we can check it. But for now, everything is fine :) just check our latest issue, it should be a nice welcoming-challenge for your open-source journey 🙂 ! |
DescriptionAdded feature and test for validating zip codes to utils Fixes #26 Type of changePlease delete options that are not relevant. [ X] New feature (non-breaking change which adds functionality) Checklist:[ X] I checked that there's no dataset update (can be done by running npm run update-dataset) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean! Thank you very much 😄
I only have the follow suggestions.
- please export this file in
index.js
and document it inREADME.md
OK, should be good now, can you please look over the documentation in the README, i tried to follow the format but i am not sure if i matched it correctly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thank you very much @xxKeefer for your contribution.
@all-contributors add @xxKeefer for code |
I've put up a pull request to add @xxKeefer! 🎉 |
Description
Added feature and test for validating zip codes to utils
Fixes # (issue)
Type of change
Please delete options that are not relevant.
Checklist:
npm run update-dataset
)npm test
passes on my machinenpm run lint
passes on my machine