-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Rename state to zipCode to avoid confusion #118
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
Conversation
Destructuring state using the regex was a little bit ambiguous since there is no state in the address (zip code instead).
@@ -102,16 +102,17 @@ setTimeout(() => { | |||
**Bad:** | |||
```javascript | |||
const address = 'One Infinite Loop, Cupertino 95014'; | |||
const cityStateRegex = /^[^,\\]+[,\\\s]+(.+?)\s*(\d{5})?$/; | |||
const city | |||
Regex = /^[^,\\]+[,\\\s]+(.+?)\s*(\d{5})?$/; |
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.
It seems to be erroneous line break here
@vsemozhetbyt My bad. Fixed it. |
@@ -102,8 +102,7 @@ setTimeout(() => { | |||
**Bad:** | |||
```javascript | |||
const address = 'One Infinite Loop, Cupertino 95014'; | |||
const city | |||
Regex = /^[^,\\]+[,\\\s]+(.+?)\s*(\d{5})?$/; | |||
const cityStateRegex = /^[^,\\]+[,\\\s]+(.+?)\s*(\d{5})?$/; |
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.
The name of the Bad regex and Good regex don't match. We should make them the same variable.
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.
Thanks for your help! I added a comment.
@ryanmcdermott Done! |
Woo hoo! Thank you Vasa! |
Pretty minor. But destructuring state using the regex was a little bit ambiguous since there is no state in the address (zip code instead).