-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add is email #39
base: master
Are you sure you want to change the base?
Add is email #39
Conversation
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.
Some fixes needed.
Update Readme.md
and make sure all Codacy tests pass.
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "checkif.js", | |||
"version": "0.0.1", | |||
"version": "0.3.1", |
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 package-lock.json
should not be updated. Please pull the repository before applying your changes
@@ -125,6 +125,16 @@ export function isWindowObject(value) { | |||
return value != null && typeof value === 'object' && 'setInterval' in value; | |||
} | |||
|
|||
/** |
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.
This should not be done in this file, but in regexp.js
as mentioned in the issue.
Check out @boristane pull request #40
*/ | ||
export function isEmail(value) { | ||
/* eslint-disable-next-line no-useless-escape */ | ||
const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; |
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.
Unreadable code.
expect(is.email('very.common@example.com')).toBeTruthy(); | ||
expect(is.email('other.email-with-hyphen@example.com')).toBeTruthy(); | ||
expect(is.email('user.name+tag+sorting@example.com')).toBeTruthy(); | ||
}); |
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.
Please add more tests (specifications mentioned in the wikipedia page)
}); | ||
test('returns false', () => { | ||
expect(is.email('john..doe@example.com')).toBeFalsy(); | ||
}); |
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.
Please add more tests (specifications mentioned in the wikipedia page)
Please apply the requested changes |
Please let me know if this helps
closes issue 23