Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template helper methods for type validation, value comparison, string functions and regex #1137

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

stuioco
Copy link
Contributor

@stuioco stuioco commented Jul 17, 2024

Added support for:

{{isNumeric '12.3'}}
{{isAlphanumeric 'abc123'}}
{{isBool 'true'}}
{{isGreaterThan '10' '11'}}
{{isLessThan '11' '10'}}
{{isBetween '1' '3' '5'}}
{{matchesRegex '2022-09-27' '^\d{4}-\d{2}-\d{2}$'}}
{{length 'thisisaverylongstring'}}
{{substring 'thisisalongstring' '7' 'the end'}}
{{rightmostCharacters 'thisisalongstring' 3}}

I have added tests and updated the documentation.
Thanks!
Stuart

@stuioco stuioco requested a review from tommysitu July 17, 2024 11:15
Copy link
Member

@tommysitu tommysitu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good 👍

@tommysitu tommysitu merged commit ed78ba2 into SpectoLabs:master Jul 17, 2024
3 checks passed
@stuioco stuioco deleted the length-template-validation branch August 15, 2024 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants