Overview
This node, named 'BR Data Utils', is designed to validate and format Brazilian data such as CPF, CNPJ, phone numbers, cell phone numbers, and postal codes (CEP). It is useful in scenarios where data integrity and formatting compliance with Brazilian standards are required, for example, validating user input in forms or cleaning data before processing.
Use Case Examples
- Validating a Brazilian cell phone number to ensure it meets the correct format and rules.
- Checking if a CPF number is valid before storing it in a database.
- Formatting a CEP (postal code) to a standardized masked format for display.
Properties
| Name | Meaning |
|---|---|
| Valor | The value to be validated or formatted by the selected operation. |
Output
JSON
operation- The operation performed, e.g., 'validarCelular' for validating a cell phone number.original- The original input value provided for validation.isValid- Boolean indicating whether the input value is valid according to the selected operation.masked- The formatted (masked) version of the input value, if applicable.unmasked- The unformatted (unmasked) version of the input value, if applicable.error- Error message if the validation or formatting failed or an unexpected error occurred.
Dependencies
- This node depends on an internal validation utility module for Brazilian data formats, which likely requires no external API but may require proper input formatting.
Troubleshooting
- Common issues include invalid input formats that do not conform to Brazilian data standards, resulting in isValid being false.
- If an unexpected error occurs, the node outputs an error message in the 'error' field; users should check the input value and ensure it matches expected formats.
- Ensure the 'operation' parameter is correctly set to one of the supported operations to avoid unexpected errors.