Skip to content

Add is email#39

Open
oaguinaga wants to merge 1 commit into
joeltankam:masterfrom
oaguinaga:add-is-email
Open

Add is email#39
oaguinaga wants to merge 1 commit into
joeltankam:masterfrom
oaguinaga:add-is-email

Conversation

@oaguinaga
Copy link
Copy Markdown

Please let me know if this helps


closes issue 23

Copy link
Copy Markdown
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.

Comment thread package-lock.json
{
"name": "checkif.js",
"version": "0.0.1",
"version": "0.3.1",
Copy link
Copy Markdown
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

Comment thread src/is/types.js
return value != null && typeof value === 'object' && 'setInterval' in value;
}

/**
Copy link
Copy Markdown
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

Comment thread src/is/types.js
*/
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
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unreadable code.

Comment thread test/is/types.test.js
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
Copy Markdown
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)

Comment thread test/is/types.test.js
});
test('returns false', () => {
expect(is.email('john..doe@example.com')).toBeFalsy();
});
Copy link
Copy Markdown
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
Copy Markdown
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