Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

oaguinaga
Copy link

Please let me know if this helps


closes issue 23

Copy link
Owner

@joeltankam joeltankam left a 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",
Copy link
Owner

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;
}

/**
Copy link
Owner

@joeltankam joeltankam Oct 12, 2018

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.jsas 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,}))$/;
Copy link
Owner

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();
});
Copy link
Owner

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();
});
Copy link
Owner

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)

@joeltankam
Copy link
Owner

Please apply the requested changes

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.

2 participants