docs: Validator.register(...) `requirement` parameter
See original GitHub issueIn the Validator.register block, what does the requirement
parameter represent?
Validator.register('telephone', function(value, requirement, attribute) { // requirement parameter defaults to null
return value.match(/^\d{3}-\d{3}-\d{4}$/);
}, 'The :attribute phone number is not in the format XXX-XXX-XXXX.');
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
docs: Validator.register(...) `requirement` parameter · Issue #271
In the Validator.register block, what does the requirement parameter represent? Validator.register('telephone', function(value, requirement, ...
Read more >Chapter 6. Creating custom constraints
To create a custom constraint, the following three steps are required: Create a constraint annotation; Implement a validator; Define a default error message ......
Read more >Validators | Blockly - Google Developers
A validator is a function that takes in the fields new value, and then acts on it. They are a simple way to...
Read more >Validation — dynaconf 2.2.3 documentation - Read the Docs
from dynaconf import settings, Validator # Register validators ... Ensure some parameters exists (are required) Validator('VERSION', 'AGE', 'NAME', ...
Read more >Validation - Dynaconf - 3.1.11
Instead of passing validators= argument to Dynaconf class you can register validators after the instance is created. settings = Dynaconf(.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mikeerickson thanks very much
@AhmedWaelElsawy The
req
value will contain any information after the semicolon in custom validation ruleWith a custom rule as
When you call execute validator, the
req
parameter would be4
in this case====
here is a test from validatorjs project