@hivi/jon

1.1.39 • Public • Published

@hivi/jon

Presentation

@hivi/jon is a dependency allowing you to validate multiple data types in a precise and fast way.

Installation

npm i @hivi/jon -s

Use

Number

import JON, {
    Validator,
    Number,
} from '@hivi/jon/jon';

const val = 50;
const schema = new JON.Number();
const res = JON.Validator.validate(
    schema,
    val
);

console.log(`> @hivi/jon | res.data:: `, res.data);
console.log(`> @hivi/jon | res.valid:: `, res.valid);
console.log(`> @hivi/jon | res.error:: `, res.error);

.min(min_value)

const schema = new JON.Number().min(3);
Arguments
Property Description Type
min_value the number to be validated must be less than or equal to min_value Number

Useful links

Readme

Keywords

Package Sidebar

Install

npm i @hivi/jon

Weekly Downloads

1

Version

1.1.39

License

MIT

Unpacked Size

171 kB

Total Files

12

Last publish

Collaborators

  • ntouba98