email-prop-type
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -13,20 +13,18 @@ 'use strict'; | ||
var emailPropType = function emailPropType(props, propName, componentName) { | ||
var requiredEmailPropType = function requiredEmailPropType(props, propName, componentName) { | ||
var value = props[propName]; | ||
if (value == null || _isemail2.default.validate(value)) { | ||
return null; | ||
if (value == null || typeof value !== 'string' || !_isemail2.default.validate(value)) { | ||
return new TypeError('Invalid Email Prop Value: ' + value + ' for ' + propName + ' in ' + componentName); | ||
} | ||
return new TypeError('Invalid Email Prop Value: ' + value + ' for ' + propName + ' in ' + componentName); | ||
return null; | ||
}; | ||
var requiredEmailPropType = function requiredEmailPropType(props, propName, componentName) { | ||
var value = props[propName]; | ||
if (_isemail2.default.validate(value)) { | ||
var emailPropType = function emailPropType(props, propName, componentName) { | ||
if (props[propName] == null) { | ||
return null; | ||
} | ||
return new TypeError('Invalid Email Prop Value: ' + value + ' for ' + propName + ' in ' + componentName); | ||
return requiredEmailPropType(props, propName, componentName); | ||
}; | ||
@@ -33,0 +31,0 @@ |
@@ -1,1 +0,1 @@ | ||
{"name":"email-prop-type","version":"1.1.1","description":"React Prop Types Email Validator","main":"./build/index.js","scripts":{"codecov":"codecov","commitmsg":"commitlint -e $GIT_PARAMS","compile":"babel -d build/ src/ --ignore node_modules,*.test.js","lint":"eslint --ext .js .","test":"jest --coverage","prepublishOnly":"npm run compile","semantic-commit":"commit","semantic-release":"semantic-release pre && npm publish && semantic-release post"},"repository":{"type":"git","url":"git+https://github.com/jaebradley/email-prop-type.git"},"keywords":["react","prop-types"],"author":"jae.b.bradley@gmail.com","license":"MIT","bugs":{"url":"https://github.com/jaebradley/email-prop-type/issues"},"homepage":"https://github.com/jaebradley/email-prop-type#readme","jest":{"testEnvironment":"node"},"devDependencies":{"@commitlint/cli":"^5.1.1","@commitlint/config-angular":"^5.1.1","@commitlint/prompt":"^5.1.2","@commitlint/prompt-cli":"^5.1.2","babel-cli":"^6.26.0","babel-preset-es2015":"^6.24.1","babel-preset-es2016":"^6.24.1","babel-preset-es2017":"^6.24.1","babel-preset-stage-0":"^6.24.1","codecov":"^3.0.0","eslint":"^4.12.0","eslint-config-airbnb-base":"^12.1.0","eslint-plugin-import":"^2.8.0","husky":"^0.14.3","jest":"^21.2.1","semantic-release":"^8.2.0"},"dependencies":{"isemail":"^3.0.0"}} | ||
{"name":"email-prop-type","version":"1.1.2","description":"React Prop Types Email Validator","main":"./build/index.js","scripts":{"codecov":"codecov","commitmsg":"commitlint -e $GIT_PARAMS","compile":"babel -d build/ src/ --ignore node_modules,*.test.js","lint":"eslint --ext .js .","test":"jest --coverage","prepublishOnly":"npm run compile","semantic-commit":"commit","semantic-release":"semantic-release pre && npm publish && semantic-release post"},"repository":{"type":"git","url":"git+https://github.com/jaebradley/email-prop-type.git"},"keywords":["react","prop-types"],"author":"jae.b.bradley@gmail.com","license":"MIT","bugs":{"url":"https://github.com/jaebradley/email-prop-type/issues"},"homepage":"https://github.com/jaebradley/email-prop-type#readme","jest":{"testEnvironment":"node"},"devDependencies":{"@commitlint/cli":"^5.1.1","@commitlint/config-angular":"^5.1.1","@commitlint/prompt":"^5.1.2","@commitlint/prompt-cli":"^5.1.2","babel-cli":"^6.26.0","babel-preset-es2015":"^6.24.1","babel-preset-es2016":"^6.24.1","babel-preset-es2017":"^6.24.1","babel-preset-stage-0":"^6.24.1","codecov":"^3.0.0","eslint":"^4.12.0","eslint-config-airbnb-base":"^12.1.0","eslint-plugin-import":"^2.8.0","husky":"^0.14.3","jest":"^21.2.1","semantic-release":"^8.2.0"},"dependencies":{"isemail":"^3.0.0"}} |
@@ -5,2 +5,3 @@ [![Build Status](https://travis-ci.org/jaebradley/email-prop-type.svg?branch=master)](https://travis-ci.org/jaebradley/email-prop-type) | ||
[![npm](https://img.shields.io/npm/v/email-prop-type.svg)](https://www.npmjs.com/package/email-prop-type) | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/jaebradley/email-prop-type.svg)](https://greenkeeper.io/) | ||
@@ -7,0 +8,0 @@ # Email Prop Type |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5884
42
28