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
Checks that `arg` conforms to the type `T` using the given `validator`. Returns an object that conforms to `T` or throws an error.
152
152
153
+
The third argument is an optional object of options:
154
+
155
+
-`allowAdditionalProperties: boolean` - If false, an error is thrown if there are any properties in addition to the ones defined in the validator. Defaults to `true`, which removes additional properties from the result.
156
+
153
157
### optional ###
154
158
Used when the property may not present on the object, or its value is undefined. Example:
155
159
@@ -422,7 +426,7 @@ validate({
422
426
423
427
### Handling Validation Errors ###
424
428
425
-
Errors will always be of the type `ValidationErrorCollection`, which has a property `error: ValidationError[]`.
429
+
Errors will always be of the type `ValidationErrorCollection`, which has a property `errors: ValidationError[]`.
426
430
427
431
The `ValidationError` type has a number of useful properties:
0 commit comments