0.1.1 • Published 1 year ago

@netclues/react-native-netclues-validator v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@netclues/react-native-netclues-validator

TypeScript React Native Platform npm version npm downloads license

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('example@example.com'); // 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


0.1.1

1 year ago

0.1.0

1 year ago