1.0.2 • Published 7 months ago

alexous-guard v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago

Alexous Guard

AlexousGuard is a service that offers methods for validating objects and arrays of objects.

Installation

npm i alexous-guard

How use

 import t from  'alexous-guard';

 const model = {
   name: "string",
   age: "number",
 };

 const object = {
   name: "John",
   age: 25,
 };

 const isValid = t.guardModel({ model, object });
 console.log(isValid);  // Return 'true' or 'false'

Validating an array

  const model = {
   name: "string",
   age: "number",
 };

 const array = [
   { name: "John", age: 25 },
   { name: "Doe", age: 30 },
 ];

 const areValid = t.guardModelArray({ model, array });
 console.log(areValid);  // Return 'true' or 'false'
1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago