You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The validator can accept an array of "types" like unique, id, or custom validation functions.
General flow:
Get the hash value of each validation function.toString(), and store it in an object such as
constvalidators={[hashval]: ()=>null,}
Iterate over each object in each definition
Get the validation function
If it is string, replace it with the hashval for that pre-defined function
If it is a function get the hash value of that function.toString(), add it to the rest of validators and replace it with the hash value.
At the end, you can potentially remove the unused pre-defined functions, but it is not necessary for a start.
Once all validators are generated, output them to a file exported as an object as the validators object above
In a separate file, create the validation executor which will be the connection between the validator functions and the hash value for each field in each definition.
The text was updated successfully, but these errors were encountered:
Libraries that can be used internally for validation:
The validator can accept an array of "types" like unique, id, or custom validation functions.
General flow:
The text was updated successfully, but these errors were encountered: