Pre-defined polices
Ready to use policies
Function argument validation
@sugoi\core comes with pre-defined policy for validating functions arguments:
failedResponseCode: number - The code will be stored under the exception if the value does not meet the criteria.
policyMeta: TValidateSchemaMeta - Meta data for validation.
Example:
Schema -
Usage -
Result:
In case the argument doesn't meet the criteria an exception will thrown with the given failed response code
Last updated