IssueRaiser

Integration of a Validation Library into Bun

### What is the problem this feature would solve? Integrate a robust validation library into Bun to streamline data validation for developers, enhancing the utility and efficiency of using Bun. Additionally, offer TypeScript support to enable type inference from validation schemas. This would be imported like `bun:sql`; It would be `bun:validation` or whatever is a fitting name. ### What is the feature you are proposing to solve the problem? While Bun provides an excellent set of tools for development, a built-in validation library can add significant value. Currently, developers have to resort to external validation libraries or custom solutions, which can be cumbersome and inconsistent. Having a standardized, built-in solution would improve the development experience and ensure data integrity. Moreover, TypeScript support can facilitate better type safety and developer tooling. 1. **Validation Types**: The library should offer various types of validations such as: - String length, format (e.g., email, URL) - Number range - Date format and range - Custom regular expressions - Required/Optional fields 2. **Nested Validation**: Support for validating nested objects and arrays. 3. **Error Messages**: Default and customizable error messages for each validation rule. 4. **Asynchronous Validation**: Support for async validators for operations like checking the availability of a username. 5. **Configurable Strictness**: Options to decide whether the val

Posted by SK-FComputer on Oct 30, 2023, 11:55 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,000 issues0 comments

support (Other)

Integration of a Validation Library into Bun

SK-FComputerOct 30, 2023, 11:55 AM

### What is the problem this feature would solve? Integrate a robust validation library into Bun to streamline data validation for developers, enhancing the utility and efficiency of using Bun. Additionally, offer TypeScript support to enable type inference from validation schemas. This would be imported like `bun:sql`; It would be `bun:validation` or whatever is a fitting name. ### What is the feature you are proposing to solve the problem? While Bun provides an excellent set of tools for development, a built-in validation library can add significant value. Currently, developers have to resort to external validation libraries or custom solutions, which can be cumbersome and inconsistent. Having a standardized, built-in solution would improve the development experience and ensure data integrity. Moreover, TypeScript support can facilitate better type safety and developer tooling. 1. **Validation Types**: The library should offer various types of validations such as: - String length, format (e.g., email, URL) - Number range - Date format and range - Custom regular expressions - Required/Optional fields 2. **Nested Validation**: Support for validating nested objects and arrays. 3. **Error Messages**: Default and customizable error messages for each validation rule. 4. **Asynchronous Validation**: Support for async validators for operations like checking the availability of a username. 5. **Configurable Strictness**: Options to decide whether the val

Comments (0)

No comments yet. Start the discussion.

Comment on this issue