class-validator
class-validator copied to clipboard
isLuhn
Description
This PR introduces the isLuhn decorator, which validates credit card numbers using the Luhn algorithm. This decorator can be applied to ensure that the provided card numbers are correctly formatted and valid according to the Luhn checksum.
Checklist
- [x] the pull request targets the default branch of the repository (
develop) - [x] the code follows the established code style of the repository
npm run prettier:checkpassesnpm run lint:checkpasses
- [x] tests are added for the changes I made (if any source code was modified)
- [x] documentation added or updated
- [x] I have run the project locally and verified that there are no errors
Instead of implementing the validation code here, we should use isLuhnNumber from validator.js