Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR makes a few changes to the TS type definitions:
type
andinterface
toexport
at the location of the definition and eliminated the exports at the end of the declaration file. Now everything should be accessible and any new definitions added, provided they follow this pattern, will end up exported without having to add them to the follow-up exported object.ValidatorConstructorOptions
was declared as atype
, but it would be better declared as aninterface
. I have adjusted this type.CheckerFunctionV1
andCheckerFunctionV2
function types, there was aschema
parameter which was set asValidationSchema
. When inspecting the parameters passed to thecustom
function, it did not appear to line up withValidationSchema
and instead was the rule's schema. This seemed to represent what the code was actually doing as it passesrule.schema
to these functions. While I definitely thinkValidationSchema
is incorrect, I'm unsure if what should be passed in this parameter isValidationRule
(which is unionValidationRuleObject | ValidationRuleObject[] | ValidationRuleName
) or a subset of that union. In my testing, I only ever sawValidationRuleObject
(single, not array) being passed in, but I'll admit I'm quite unsure of what can actually get passed into the custom function.