Skip to content

v1.0.3

Choose a tag to compare

@Srabutdotcom Srabutdotcom released this 26 May 15:33
· 1 commit to master since this release

Validate value based on types and/ or instance and / or values.
for example if i want to validate variable named "myvalue" with types = ["number"] and values = [20, 33]
just call

const isValid = validate(myvalue, ["number"], [20, 33])
// isValid will return either "true" if it is 20 or 30 otherwise will return "TypeError"

argument 1 and 2 is optional, if you don't provide it myvalue will be any types and any values