0.1.4 • Published 1 year ago

vivid-vertex-validators v0.1.4

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

Vivid Vertex Validators

A lightweight library for complex data validation in JavaScript applications. Vivid Vertex Validators utilizes popular validation libraries to provide a unified and easy-to-use interface for validating data structures against defined schemas.

Features

  • Leverages powerful validation libraries like AJV, Joi, and Yup.
  • Provides simple and intuitive API for data validation.
  • Lightweight and flexible, easy to integrate into any project.
  • Supports custom validation rules and messages.

Installation

npm install vivid-vertex-validators

Quick Start

Import Vivid Vertex Validators and use it to validate your data against a schema:

const { validateData } = require('vivid-vertex-validators');

const schema = {
type: 'object',
properties: {
name: {type: 'string'},
age: {type: 'number', minimum: 0}
},
required: ['name', 'age'],
additionalProperties: false
};

const data = {
name: 'John Doe',
age: 30
};

const isValid = validateData(schema, data);
if (isValid) {
console.log('Validation passed!');
} else {
console.log('Validation failed.');
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

2 years ago