@decaf-ts/decorator-validation
Version:
simple decorator based validation engine
43 lines (42 loc) • 1.62 kB
TypeScript
/**
* Validates whether two values are eligible for comparison using >= or <= operators.
*
* Supported types: `undefined`, `number`, `bigint`, and `Date`.
*
* @param a - The first value to compare.
* @param b - The second value to compare.
*
* @returns {boolean} True if both values are of supported types.
*
* @throws {TypeError} If either value is of an unsupported type.
* @memberOf module:decorator-validation
*/
export declare function isValidForGteOrLteComparison(a: any, b: any): boolean;
/**
* @summary Compares two values to determine if the first is less than the second.
* @description Supports numbers and dates. Throws an error for unsupported types.
*
* @param {any} a - The first value to compare.
* @param {any} b - The second value to compare against.
*
* @returns {boolean} True if `a` is less than `b`, false otherwise.
*
* @throws {Error} If either `a` or `b` is `null` or `undefined`.
* @throws {TypeError} If values are of mismatched or unsupported types.
* @memberOf module:decorator-validation
*/
export declare function isLessThan(a: any, b: any): boolean;
/**
* Checks if `a` is greater than `b`.
* Supports comparison for numbers and Date objects.
*
* @param {any} a - The value to validate.
* @param {any} b - The value to compare against.
*
* @returns {boolean} True if `a` is greater than `b`, otherwise false.
*
* @throws {Error} If either `a` or `b` is `null` or `undefined`.
* @throws {TypeError} If values are of mismatched or unsupported types.
* @memberOf module:decorator-validation
*/
export declare function isGreaterThan(a: any, b: any): boolean;