@apizr-io/class-utils
Version:
Package containing all class-validator function with all custom apizr class validation functions
15 lines (14 loc) • 786 B
TypeScript
import { ValidationOptions } from 'class-validator';
/**
* @param {function} conditionFunc - The condition to check
* @param {object} options - The options to pass to the decorator
* @param {string} options.jsonpath - The jsonpath to use to get the object to check
* @param {ValidationOptions} options.validationOptions - The validation options to pass to the decorator
*
* @description Decorator that checks if a property must not exist if a condition is true.
* Ignores other decorators on the property if it does not exist and the condition is true.
*/
export declare function MustNotExistIf(conditionFunc: <T>(object: T) => boolean, options?: {
jsonpath?: string;
validationOptions?: ValidationOptions;
}): <T>(object: NonNullable<T>, propertyName: string) => void;