CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-vuelidate--validators

Comprehensive validation library for Vue.js applications providing common validators with built-in error messages and customization options

87

1.14x
Overview
Eval results
Files

task.mdevals/scenario-1/

User Profile Validator

A validation system for a user profile form with nested address and contact information structures.

Capabilities

Validates basic user information

The system validates the top-level fields of a user profile including username and age.

  • Validates that username is required and contains only alphanumeric characters @test
  • Validates that age is required and must be an integer between 18 and 120 @test

Validates nested address object

The system validates a nested address object containing street, city, and postal code.

  • Validates that address.street is required and has minimum length of 5 characters @test
  • Validates that address.city is required and contains only alphabetic characters @test
  • Validates that address.postalCode is required and has exactly 5 numeric characters @test

Validates nested contact information object

The system validates a nested contact object with email and phone number.

  • Validates that contact.email is required and follows valid email format @test
  • Validates that contact.phone is numeric and has minimum length of 10 digits @test

Validates array of emergency contacts

The system validates an array of emergency contact objects, each with name and phone fields.

  • Validates that emergencyContacts is an array where each item has a required name field @test
  • Validates that each emergency contact has a numeric phone field with minimum length of 10 @test

Implementation

@generates

API

/**
 * Creates validation rules for a user profile with nested structures
 * @param {Object} state - The reactive state object containing user profile data
 * @returns {Object} Validation rules object compatible with useVuelidate
 */
function createProfileValidation(state);

module.exports = { createProfileValidation };

Dependencies { .dependencies }

@vuelidate/core { .dependency }

Provides the core validation composable and state management functionality.

@vuelidate/validators { .dependency }

Provides built-in validators including required, email, numeric, alpha, alphaNum, integer, minLength, maxLength, minValue, maxValue, and between validators.

Install with Tessl CLI

npx tessl i tessl/npm-vuelidate--validators

tile.json