express-validator
express-validator copied to clipboard
docs: mention `ContextBuilder` returned from `#check()`
Description
We mention in the docs that ContextBuilder
is exposed in the result of #check()
middleware.
~~This allows to get the properties of the builder.~~ ~~It can be used to create a library based on the context that will be built.~~ ~~(e.g. swagger docs generation)~~
~~I don't know if it is better to expose the properties in this way or to build a "local" context, @gustavohenke what do you think?~~
To-do list
- [x] I have added tests for what I changed.
- [x] This pull request is ready to merge.
Coverage remained the same at 100.0% when pulling 939bae65570505a1a9d2a21f538d49257a781dd9 on fedeci:get-builder-properties into 690cd636df27cd5d32ad4f0e3f6ca783d86f873f on express-validator:master.
Yes, for example in check
it is exposed here.
Maybe we should just document this so that the end user could create his own context with all his methods and not only access properties through the builder.
https://github.com/express-validator/express-validator/blob/7f15d2d963574f34e0e312a96228b7b0693df1cf/src/middlewares/check.ts#L32-L40
Oops nope, asked review for the wrong PR😄