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) • 901 B
TypeScript
import { RequiredValidation } from '../../core.js';
import '../../commonTypes.js';
import '../../InferType.js';
import '../../helpers/constants.js';
/**
* @description Asserts that a string value contains at least one uppercase character.
* @returns {RequiredValidation} A validation function that takes a received string and an exception context.
* @throws {ValidationError} if the received value does not contain at least one uppercase character.
* @example
* const schema = string().custom(atLeastOneUpperChar());
* parseOrFail(schema, 'abcDEF'); // Valid
* parseOrFail(schema, 'abcdef'); // Throws an error: 'The received value does not contain at least one uppercase character'
*
* @translation Error Translation Key = 's:atLeastOneUpperChar'
*/
declare const atLeastOneUpperChar: {
(): RequiredValidation;
key: string;
message: string;
};
export { atLeastOneUpperChar };