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(),
})
};
Problem
Currently, Yelix's validation system uses
inp()as the function to define validation rules. Whileinpis 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: