@netclues/react-native-netclues-validator
v0.1.1
Published
The Validator package offers a comprehensive suite of validation methods for common data types, including email, phone number, strong password, credit card number, and CVV. It also includes functionality to determine credit card types based on card number
Downloads
7
Maintainers
Readme
@netclues/react-native-netclues-validator
The Validator package offers a comprehensive suite of validation methods for common data types, including email, phone number, strong password, credit card number, and CVV. It also includes functionality to determine credit card types based on card numbers. With predefined regular expressions and flexible customization options, this package ensures robust and accurate validation for various use cases.
Installation
Using npm:
npm install @netclues/react-native-netclues-validator
or using yarn:
yarn add @netclues/react-native-netclues-validator
Usage
Importing the Validator
import { Validator } from 'react-native-netclues-validator';
Check if a value is empty
const isEmpty = Validator.isEmpty(''); // true
Validate an email address
const isValidEmail = Validator.emailValidate('[email protected]'); // true
Validate a phone number
const isValidPhone = Validator.phoneNumberValidate('+1234567890'); // true
Validate a strong password
const isValidPassword = Validator.strongPasswordValidate('Password123!'); // true
Validate a credit card number
const isValidCardNumber = Validator.creditCardNumberValidate('4111 1111 1111 1111'); // true
Validate a CVV code
const isValidCVV = Validator.cvvValidate('123', 'Visa'); // true
Get the type of a credit card
const cardType = Validator.getcardType('4111 1111 1111 1111'); // 'Visa'
License
MIT