Skip to content

Releases: express-validator/express-validator

v5.0.3

03 Mar 03:32
Compare
Choose a tag to compare
  • Don't set undefined values into request when validated key does not exist

v5.0.2

26 Feb 13:59
Compare
Choose a tag to compare
  • #521 - typescript: add standard sanitizers back to legacy's sanization chain interface

v5.0.1

17 Feb 12:40
Compare
Choose a tag to compare
  • #525, #528 - typescript: add exists to the schema definition

v5.0.0

10 Feb 13:35
Compare
Choose a tag to compare

No more new features will be added to the legacy API! Only bug fixes will be accepted.

BREAKING CHANGES 💥

  • #461 - check: sanitizers now persist the sanitized value back to the request. This was previously only the case for sanitizers used from the filter API
  • #463 - check: standard validators will now use an array's first item only
  • @types/express dependency removed; if you're using express, you must install this yourself now

New features ✨

  • #433, #511, #512 - check: bring schema support back with new checkSchema() function
  • #445, #481, #516 - check, filter: add support for custom sanitizers via .customSanitizer() chain function
  • #466, #469, #489, #498 - check: accept dynamic message creator function in .withMessage()
  • #474 - check: add validationResult.withDefaults() which can create a validationResult function with default options set
  • check, filter: build custom check/sanitize functions with buildCheckFunction or buildSanitizeFunction, respectively

Other changes 🐛

  • #444 - check: make custom validators that resolve a promise succeed without needing to return a truthy value
  • #458, #492 - check: partially fix wildcard issues with inexistent fields
  • #414, #484 - docs: further describe when and how to use wildcards
  • #462 - docs: add .formatWith() example
  • #483 - docs: fix locations accepted in matchedData()
  • #482 - filter: make oneOf() and matchedData() work together
  • #496 - Revamp TypeScript support in the library
  • Update validator to v9.4.0

v4.3.0

29 Oct 17:43
Compare
Choose a tag to compare
  • #434, #446 - check: accept subgroups of validations
  • #447, #453 - filter: list locations to get data from when using matchedData()
  • #441 - Add nullable option to .optional()

v4.2.2

30 Sep 00:20
Compare
Choose a tag to compare

⚠️ Incorrectly tagged version. Not published to npm.

v4.2.1

23 Sep 18:44
Compare
Choose a tag to compare
  • #425 - Don't sanitize non-string values

v4.2.0

20 Sep 03:18
Compare
Choose a tag to compare
  • #299 - legacy: use pretty message when validator used in schema doesn't exist
  • #401 - typescript: set withMessage() arg type to any
  • #406 - docs: fix req.asyncValidationErrors() return value description
  • #410 - docs: don't show .throw() without try..catch
  • #411 - check: make validationResult work even though no validators ran
  • check: add sanitization chain methods
  • filter: add standalone sanitization middleware
  • Remove deprecation warnings from legacy APIs
  • Update validator to v8.2.0

v4.1.1

02 Sep 02:25
Compare
Choose a tag to compare
  • #398, #403 - don't fail when .withMessage() is called without any validator
  • #399 - check: convert value to string just like in v3 (undefined, null, NaN, [] => '')
  • #400 - check: use any rejection cause as error message
  • #401 - legacy: restore support for non-string error messages

v4.1.0

29 Aug 00:47
Compare
Choose a tag to compare
  • #392, #393 - Add .formatWith(formatter) to the validation result API
  • #390 - Add .exists() to the TypeScript typings