Streamlined TypeScript validation functions for your projects.
Project details
jet-validators is a comprehensive collection of TypeScript validator-functions designed to simplify your coding experience. With a variety of utilities at your disposal, you can ensure data integrity and validation with minimal effort, allowing you to focus on what truly matters in your development process.
jet-validators is a comprehensive collection of TypeScript validator functions and utilities designed to simplify your data validation tasks. This library lightens your coding load by offering a plethora of pre-defined validator functions tailored to meet a wide range of real-world scenarios you’re likely to encounter.
Effortlessly validate your data with jet-validators:
import { isOptionalString, isBooleanArray } from 'jet-validators';
if (isOptionalString(val)) {
// val is string | undefined
}
if (isBooleanArray(val)) {
// val is boolean[]
}
Basic Validators: Take advantage of a straightforward list of validators including, but not limited to:
isNull, isUndefined, isNullOrUndefinedisBoolean, isBooleanArray, isValidBooleanisNumber, isBigInt, isValidNumberisString, isNonEmptyString, isAlphaNumericStringisObject, isRecord, isFunctionRegular Expressions: Validate strings against patterns by using functions like isEmail, isUrl, and isColor with the ability to modify pattern definitions using environment variables.
Complex Validators: Tailored validators for specific needs, such as checking if a value exists in an array with isInArray, or validating value ranges with isInRange.
Leverage utilities to modify values before validation or for validating object schemas:
nonNullable, iterateObjectEntries, and transform.parseObject and testObject for validating schemas with the ability to handle observed errors seamlessly.jet-validators is not a replacement for complex schema validation libraries such as zod or ajv but rather a practical tool to streamline data validation within your TypeScript applications. Whether you need fundamental validation functions or utilities for object schema checks, jet-validators has you covered!
Comments
0Start the conversation
Share the first comment.