react-input-validator
Advanced tools
+1
-1
| { | ||
| "name": "react-input-validator", | ||
| "version": "1.1.6", | ||
| "version": "1.2.0", | ||
| "description": "react-input-validator is input super class validator", | ||
@@ -5,0 +5,0 @@ "main": "Client/src/InputValidator/InputValidator.es5.js", |
+41
-2
@@ -38,3 +38,42 @@ | ||
| # Live Example (See Examples folder for more implementations examples) | ||
| <img src="https://cdn.rawgit.com/Attrash-Islam/react-input-validator/master/Images/Examples.gif" /> | ||
| # Example (See Examples folder for more implementations examples) | ||
| ``` | ||
| import InputValidator from 'react-input-validator'; | ||
| class PhoneInput extends InputValidator { | ||
| constructor(props) { | ||
| super(props); | ||
| } | ||
| render() { | ||
| return ( | ||
| <div className={'relative-pos form-group' + super.getValidationClass()}> | ||
| <label htmlFor="phone-input">Phone Number:</label> | ||
| <input type="text" | ||
| ref={node => this.phoneRef = node} | ||
| onChange={() => { super.onInputChange(this.phoneRef, this.validatePhone) }} | ||
| className="form-control" id="phone-input" /> | ||
| <i className="hidden fa fa-spin fa-spinner"></i> | ||
| </div> | ||
| ) | ||
| } | ||
| validatePhone() { | ||
| //Pattern: xxx-xxxxxxx || xxxxxxxxxx | ||
| let phoneRegex = /^[0-9][0-9][0-9](-?)[0-9][0-9][0-9][0-9][0-9][0-9][0-9]$/; | ||
| if(phoneRegex.test(this.phoneRef.value)) { | ||
| return true; | ||
| } else if (!phoneRegex.test(this.phoneRef.value)) { | ||
| return false; | ||
| } | ||
| } | ||
| } | ||
| export default PhoneInput; | ||
| ``` | ||
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
79
97.5%1893737
-58.31%25
-3.85%