Skip to content

Commit

Permalink
Remove prop-type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
Coston Perkins committed Nov 2, 2018
1 parent 6b209c1 commit daae22e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 42 deletions.
20 changes: 1 addition & 19 deletions dist/obfuscate.js
Expand Up @@ -12,8 +12,6 @@ var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
Expand Down Expand Up @@ -66,7 +64,7 @@ var Obfuscate = function (_Component) {
_createClass(Obfuscate, [{
key: 'render',
value: function render() {
return this.props.obfuscate ? this.renderObfuscatedLink() : this.renderLink();
return this.props.obfuscate === false ? this.renderLink() : this.renderObfuscatedLink();
}
}, {
key: 'renderLink',
Expand Down Expand Up @@ -164,20 +162,4 @@ var Obfuscate = function (_Component) {
return Obfuscate;
}(_react.Component);

Obfuscate.propTypes = {
children: _propTypes.node,
tel: _propTypes.string,
sms: _propTypes.string,
facetime: _propTypes.string,
email: _propTypes.string,
headers: _propTypes.object,
obfuscate: _propTypes.bool,
style: _propTypes.object,
linkText: _propTypes.string
};

Obfuscate.defaultProps = {
obfuscate: true
};

exports.default = Obfuscate;
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "react-obfuscate",
"version": "2.1.10",
"version": "2.2.0",
"description": "An intelligent React component to obfuscate any contact link",
"main": "dist/obfuscate.js",
"files": [
Expand Down Expand Up @@ -64,7 +64,6 @@
"identity-obj-proxy": "^3.0.0",
"jest": "^23.5.0",
"prettier": "^1.14.2",
"prop-types": "^15.6.2",
"react": "^16.4.2",
"react-addons-test-utils": "^15.6.2",
"react-dom": "^16.4.2",
Expand Down
23 changes: 3 additions & 20 deletions src/obfuscate.js
@@ -1,5 +1,4 @@
import React, { Component } from 'react'
import { node, string, object, bool } from 'prop-types'

const combineHeaders = (params = {}) => {
return Object.keys(params)
Expand Down Expand Up @@ -32,9 +31,9 @@ class Obfuscate extends Component {
}
}
render() {
return this.props.obfuscate
? this.renderObfuscatedLink()
: this.renderLink()
return this.props.obfuscate === false
? this.renderLink()
: this.renderObfuscatedLink()
}

renderLink() {
Expand Down Expand Up @@ -128,20 +127,4 @@ class Obfuscate extends Component {
}
}

Obfuscate.propTypes = {
children: node,
tel: string,
sms: string,
facetime: string,
email: string,
headers: object,
obfuscate: bool,
style: object,
linkText: string,
}

Obfuscate.defaultProps = {
obfuscate: true,
}

export default Obfuscate

0 comments on commit daae22e

Please sign in to comment.