1.1.7 • Published 2 years ago

reuseablecomponent v1.1.7

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Error Handler for Your Project

This npm package provides robust error handling capabilities for your project, allowing you to easily manage and validate various types of data.

Installation

To install the package, use the following command :

npm install reuseablecomponents

Usage

Import the "ValidateData" object from 'reuseablecomponents' in your project

import { ValidateData} from 'reuseablecomponents';

The ValidateData object is a collection of validation functions for different types of data. Each function takes a value v as input and returns an object with a message property indicating the validation result. / In your handlechange function pass your target value and check for the type(i.e...emailID validation ,password validatation,Mobile Number Validatation,etc...) /

Example

const handleChange =(e)=>{

    const  check = ValidateData.email(e.target.value).require()
// check will have  an object In that object 
We have 2 keys  namely  requried and  message

}

Code image

Here

Requried

Requried key will throw an error if there is an Empty Field.

Message

Regex pattern used ^^\s$&*!#^@+@^\s@+.(^\s@{2,3})+$ Message key will throw an error if there is an Regex Error in the entered EmailID. Web image

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago