I was suggested to use this Indicative package, so far so good but I was reading the docs and can't find a rule to check whether the variable is defined
required almost did the job but if the string or array is empty it will throw an error, which I want it to be okay
I tried this too
let rules{
username:"string"
}
But if the username is undefined for some reason it doesn't throw an error even though the username property isn't there and it definitely isn't a string
If this rule does not exist I would want to edit the library and add it my self, but I'm beginning to learn JavaScript I don't know how to approach this