Skip to content

feature: Improve ValidateIf types #2591

Open
@karlismelderis-mckinsey

Description

Description

Please consider to improve ValidateIf type and replace any with Record<string, unknown> or any stricter type option

this is an override that worked for us:

declare module 'class-validator' {
  export declare function ValidateIf(
    condition: (object: Record<string, unknown>, value: never) => boolean,
    validationOptions?: ValidationOptions,
  ): PropertyDecorator;
}

I guess object type can be improved to be more generic - Record<string | number | symbol, unknown> 🤔

Proposed solution

Metadata

Metadata

Assignees

No one assigned

    Labels

    flag: needs discussionIssues which needs discussion before implementation.type: featureIssues related to new features.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions