@nexapp/react-native-text-input-validator
TypeScript icon, indicating that this package has built-in type declarations

0.0.0 • Public • Published

TextInputValidator

What is it ?

Utility class that allow you to validate text formats for valid emails format, non-empty text and/or text matching.

Installation

npm install @nexapp/react-native-text-input-validator --save

or

yarn add @nexapp/react-native-text-input-validator

Usage

import { TextInputValidator } from "@nexapp/react-native-text-input-validator"

Use to validate email

const validation = TextInputValidator.validateEmail("chucknorris@nexapp.ca");

The return value will be one of the following :
TextInputValidation.Empty
TextInputValidation.Valid
TextInputValidation.BadEmailFormat

Use to validate passwords

const validation =  TextInputValidator.validatePasswords("12345", "12345");

The return value will be one of the following :
TextInputValidation.Empty
TextInputValidation.DoNotMatch
TextInputValidation.Valid

Use to validate that a field is not empty

const validation =  TextInputValidator.validateNotEmpty("notEmptyString");

The return value will be one of the following :
TextInputValidation.Empty
TextInputValidation.Valid

Licence

MIT

Package Sidebar

Install

npm i @nexapp/react-native-text-input-validator

Weekly Downloads

0

Version

0.0.0

License

MIT

Unpacked Size

8.64 kB

Total Files

11

Last publish

Collaborators

  • jgdoyon-nexapp
  • pluc_nexapp
  • mbergeron
  • tristanod
  • hsebouai-nexapp
  • sebdufbeau
  • gabsima-nexapp
  • drichard-nexapp