arya_data_validator

1.0.6 • Public • Published

Arya Data Validator

npm version License

Arya Data Validator is a versatile and comprehensive JavaScript library for validating data inputs. It offers a wide range of validation rules and functions to ensure data integrity and enforce specific data requirements.

Features

  • Supports validation for various data types, including strings, numbers, arrays, and objects.
  • Validates required fields, data formats, lengths, ranges, and more.
  • Provides an intuitive and flexible API with customizable validation rules.
  • Lightweight and dependency-free.
  • Compatible with both Node.js and browser environments.

Installation

You can install the Arya Data Validator package via npm:

npm install arya_data_validator

Usage

const aryaDataValidator = require('arya_data_validator);
const aryaDataValidator = require('arya_data_validator');

let expectedObj = [
    { type: 'number', name: 'phoneNumber', isRequired: true, minLength: 7, maxLength: 10 },
    { type: 'string', name: 'name', isRequired: true, maximumLength: 10, startsWith: ['p', 'P'] },
];
let inputObj = {
    phoneNumber: 89123456,
    name: 'Prakersh'
}
console.log(aryaDataValidator.validateData(inputObj, expectedObj))
// output: {result: true}

NUMBER

STRING

ARRAY

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request on the GitHub repository (https://github.com/Prakersh123).

License

This package is open source and available under the MIT License.

Credits

Arya Data Validator is developed and maintained by Prakersh Kumar Arya.

Package Sidebar

Install

npm i arya_data_validator

Weekly Downloads

3

Version

1.0.6

License

ISC

Unpacked Size

91.7 kB

Total Files

20

Last publish

Collaborators

  • prakersh