Releases: adonisjs/validator
Releases · adonisjs/validator
Bug fixes and added new rule
Bug fixes
- Fixed
beforeField
,afterField
,beforeOrEqualToField
andafterOrEqualToField
rules - Fixed
minLength
andmaxLength
rules to validate the original value length and not the mutated value length.
Addtion
- Added
equalTo
rule to ensure the field value equals a static literal value.
Commits
- chore(deps): bump lodash from 4.17.15 to 4.17.20 (#100) f360554
- refactor: update rules to accept rulesTree during the compile phase 29c5f45
- fix: after/before field rules convert value to datetime instance b238710
- refactor: minLength & maxLength guard against undefine values d86be55
- fix: minLength and maxLength should check against the original value 71e9b3a
- chore(package): update dependencies ac08ced
- feat: add equalTo rule 219deb1
Passing refs to the validate methods
Adding new rules
Rules Added
All of the following rules are related to dates
after
afterField
afterOrEqualToField
before
beforeField
beforeOrEqualToField
The following rule allows blacklisting keywords. Keywords are matched against string
, number
and date
data types.
blacklist
Improvements
The confirmed
rule now allows defining a custom field name. Helpful when you are accepting all data in camelCase and just one field is in snake case.
rules.confirmed('passwordConfirmation')
Commits
- style: comment out example code a2680fa
- chore: update dependencies 63633ca
- docs(README): update links 75badc1
- docs(README): update tagline fe3c8b2
- docs(README): update readme file a1d4c7a
- refactor: make errors more consistent 3b42ca3
- feat: add blacklist rule c25e22b
- feat: add more date comparison rules 0a0001f
- feat: add resolveAbsoluteName helper e639c6c
- refactor: improvements to the confirmed rule error output af1429b
- feat: add before,after,beforeField and afterField rules 39d4bf8
- test: add provider test 9a8d852
- improvement: do not flash _method during validation exception d01e16b
- feat(confirmed): add support for defining custom field name 53c8624
- feat: add schema.object.anyMembers to be compatible with array signature 17722ea
- chore: remove pope dependency c8730be
- chore: remove endent dependency d763909
- chore: format/update meta files 8f046e3
- chore: update dependencies 43c08a1
- chore(release): 7.3.2 a27c190
- feat: add range rule (#89) 53b4b96
- fix: Add 'true' and 'false' to boolean value (#86) (#87) 86f5486
- chore: update dependencies 55a3a3f
Updating underlying dependencies
- chore: update dependencies 55a3a3f
Exporting reporters
- feat: export reporters 878ba3d
Adding support for refs and other improvements
Refs
Refs allows referencing runtime values in the cached schema. Read the official docs to learn how it works.
https://preview.adonisjs.com/guides/validator/schema-caching#option-3-using-refs
- docs: update benchmark image ac4cd3e
- fix: types 2120229
- improvement: turn off string trimming by default e503450
- improvement: export isRef in helpers 4e3f0a2
- improvement(requiredWhen): add support for refs 65af941
- feat: export helpers required for adding custom rules 86a7120
- feat: add distinct rule 3d9422a
- improvement: scope min and max validations to their node subtype 5794257
- feat(alpha): add support for allowing "space", "dash" and "underscore" 207c4f1
- refactor: depereciate "addType" and "addRule" in favor of "type" and "rule" c2f1486
- feat: add support for wildcard messages handler ed5a673
- improvement: pass validation options to the error reporter da76275
- refactor: ip rule accept version as a number 620d38f
- refactor: cleanup validation rules compile functions c764e67
- test: fix breaking tests 54acbdc
- chore: update dependencies bd4c554
- feat: add support for refs 88df5b5
- improvement(boolean): handle "on" and "off" string. cd0a401
- feat: add support for micro templating 9d08a27
- chore: update dependencies 4524097
- fix: requiredWhen - for values: false and 0 (#83) 29bf541
Getting ready for Typescript 3.9
- improvement: for types after typescript 3.9 release ff2160b
Improvements to the api and json api errors output
- improvement: move api errors inside the errors key 7e4b13f
Adding new rules
Highlights
- Add
regex
rule. @gusflopes - Add
uuid
rule. @benswinburne - Return error messages as JSON when it's an Ajax request.
Commits
- improvement: hardening regex rule 4b54690
- refactor: use ternary operator afe988d
- improvement: convert regex rule to string during compile phase c46a2c8
- improvement: show messages as json when its an ajax request aa99e00
- chore: update dependencies 38d2ef4
- feat: added uuid validation rule (#80) 142d025
- feat: RegExp validation rule (#81) 9b8430e
- refactor: use _csrf field when ignoring its value from flash messages 5584c97
- chore: update dependencies 88341c2