Closed McSneaky closed 2 years ago
Yeah, makes sense to have them set to false
. However, it will be a breaking change now, so can only be released in the next major release
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I am going to extract the normalization of the email to its own rule and deprecate the sanitize
option all together. This is how it will look in practice.
email: schema.string([
rules.email(),
rules.normalizeEmail({
// pass options here
})
])
If you decide not to pass any options, then the defaults from validator.js will be used. In other words, AdonisJS will not turn on/off any options
@thetutlage does this improvement make the rules.email function deprecated? because I receive deprecation warning when I am using rules.email
@ryanadhi You can learn more about the deprecation in the release notes. https://docs.adonisjs.com/releases/april-2022-release#email-sanitize
@ryanadhi You can learn more about the deprecation in the release notes. https://docs.adonisjs.com/releases/april-2022-release#email-sanitize
does this also remove dots before the '@' ? some emails has dots before '@'
Package version
12.2.0
Node.js and npm version
Node: 17.1.0 npm: 8.1.2
Sample Code (to reproduce the issue)
Request payload
Validator
Expected outcome:
Actual outcome
I would expect current outcome, when sanitize is set to just
true
(sanitize: true
) or when all keys are all set totrue
Currently both
and
give exactly the same result
Not sure if it's like that by design? I'd kinda expect all the keys to be
false
by defaultWilling to file in PR, to fix it, but since I'm not sure if it's bug or feature didn't do PR first 🙂
BONUS (a sample repo to reproduce the issue)