Checks if the processed numeric value falls within a specified range.
Copy
Ask AI
score: Property.Number({ displayName: 'Score', required: true, processors: [], validators: [Validators.inRange(0, 100)], // The range is inclusive (0 to 100).})
Example:Note: The custom validator allows you to define your own validation logic and error message. It can be used to perform complex validations beyond the provided built-in validators.
Copy
Ask AI
const customValidator = { type: ValidationInputType.STRING, fn: (property, processedValue, userInput) => { // Your custom validation logic here if (validationFails) { return "Validation Error: Your custom error message."; } return null; }};
Processors act as data transformers, enabling you to transform or process user input before further processing.To add a custom processor, you can define a function with this type ProcessorFn that takes two parameters: The function should return the processed value. Here’s an example: