Verifyr
Verify data in an chain like syntax
const Verify = ; "verifyr is the best!!!";
Chaining
Instead of making long if/else statements verifyr allows you to do complex statements with very simple chains Example
var data = "i dont use chain statements ;("console
Can be turned into
var data = "i use awesome chain statements";console;
Valid Types
used with the .is()
/.isnt()
functions or by getting the property .type
bool
any boolean (true/false)number
any numberstring
any stringarray
any arrayobject
any JSON/Pure javascript object
.is()
/.isnt()
Types only supported using phone
a valid phone number format (CANNOT VERIFY NUMBER IS IN USE)email
a valid email format (CANNOT VERIFY EMAIL EXISTS)
Methods
Save
takes one optional paramater, if this paramater is true the save will return the .v()
response of the save
if false/left out the save will return the whole Verify class for that object that you can call more functions on
Example
var save = ;//can call extra functions on this console; //true var save2 = ; //cant call extra functions on this console;//true
When creating a template for .save()
make sure to specify the type if you would like type specific functions like new Verify("object")
V/Valid
call .v() or .valid() on a Verify function to return a boolean that shows if the statement is valid
Length
called on a verifyr object and takes two paramaters min + max length, if either of these varables are -1 it will be infinate in that direction
Example
"test"length04// true"test"length23// false
Is
sees if type of object is same as parameter
view valid types here
Example
"test"//true
Isnt
sees if type of object is diffrent than parameter
view valid types here
Example
a2//true
Has
sees if string/array includes provided parameter
Example
Verifyr is amazing//true
Equals
returns if data is equal to parameter
Example
"test"//true
Array specific functions
Each
Run a function for each item with the item as paramaters, function must return a bool
Example
"1""1" //makes sure each item is "1"//true
Object specific functions
Has Child
sees if the object has a child with a specific name
Example
x:1y:2//true
Child
goes to child + sets current data to child
Example
x:"string 1"y:"string 2" //true
Parent
goes to parent + sets current data to parent
Example
x:"string 1"y:false parent //true