class-validator
class-validator copied to clipboard
feat: add IsDuration decorator
Description
Add IsDuration decorator for checking duration strings (e.g. "30 Days", "1 week", "10s"). It is designed to match the format of ms, since it's widely used among libraries for duration conversion.
Checklist
- [x] the pull request title describes what this PR does (not a vague title like
Update index.md) - [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:checkpasses -
npm 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
Fixes
fixes #2613
@braaar sorry for the tag, it has been almost 4 months waiting for this PR to be checked, would any of the maintainers take a quick look 🙏🙏