bguard
Version:
**bguard** is a powerful, flexible, and type-safe validation library for TypeScript. It allows developers to define validation schemas for their data structures and ensures that data conforms to the expected types and constraints.
24 lines (21 loc) • 781 B
text/typescript
import { RequiredValidation } from '../../core.mjs';
import '../../commonTypes.mjs';
import '../../InferType.mjs';
import '../../helpers/constants.mjs';
/**
* @description Asserts that a string value is in lowercase.
* @returns {RequiredValidation} A validation function that takes a received string and an exception context.
* @throws {ValidationError} if the received value is not in lowercase.
* @example
* const schema = string().custom(lowerCase());
* parseOrFail(schema, 'valid'); // Valid
* parseOrFail(schema, 'Invalid'); // Throws an error: 'The received value is not in lowercase'
*
* @translation Error Translation Key = 's:lowerCase'
*/
declare const lowerCase: {
(): RequiredValidation;
key: string;
message: string;
};
export { lowerCase };