Skip to content

Rename inp() to a More Descriptive Name for Clarity #18

Description

@GroophyLifefor

Problem

Currently, Yelix's validation system uses inp() as the function to define validation rules. While inp is short for "input," it may not be intuitive for all users. Additionally, since Yelix may support output validation in the future, having a clearer name would improve readability and maintainability.

Proposed Solution

Rename inp() to a more descriptive and intuitive name, such as:

  • input() – Explicitly refers to input validation.
  • validate() – Aligns with the purpose of defining validation rules.
  • field() – Emphasizes defining a field's validation.

Current Usage:

export const validation: ValidationType = {
  query: {
    page: inp().number().integer().min(1).optional(),
    limit: inp().number().integer().range(1, 100),
    isActive: inp().boolean().transform()
  },
  body: inp().object({
    username: inp().string().min(3).max(255),
    email: inp().string().email(),
  })
};

Metadata

Metadata

Labels

questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions