The value resolved from the package's exported function contains a status that is 0 (if successful) or -1 (otherwise). Also, the message object has a type field that is either error or success. This information is redundant. I propose that we simplify the API by only having the status property.
To tell the truth, both the overall status and overall message are unneeded. Maybe the only thing that should be returned is the packages array, detailing the results of each validation. Clients can display whatever they want based on that array.
Also, I would also recommend changing status to succeeded and making it a boolean so that it is easier to understand.
The value resolved from the package's exported function contains a
statusthat is 0 (if successful) or -1 (otherwise). Also, themessageobject has atypefield that is eithererrororsuccess. This information is redundant. I propose that we simplify the API by only having thestatusproperty.To tell the truth, both the overall
statusand overallmessageare unneeded. Maybe the only thing that should be returned is thepackagesarray, detailing the results of each validation. Clients can display whatever they want based on that array.Also, I would also recommend changing
statustosucceededand making it a boolean so that it is easier to understand.