Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IValidation.IError.data property. #1421

Merged
merged 6 commits into from
Dec 10, 2024
Merged

Add IValidation.IError.data property. #1421

merged 6 commits into from
Dec 10, 2024

Conversation

samchon
Copy link
Owner

@samchon samchon commented Dec 10, 2024

Even when the validation is failed, its origin data should be filled.

This PR fills the input data in the IValidation.IError.data property.

export type IValidation<T = unknown> =
  | IValidation.ISuccess<T>
  | IValidation.IFailure;
export namespace IValidation {
  export interface ISuccess<T = unknown> {
    success: true;
    data: T;
  }
  export interface IFailure {
    success: false;
    data: unknown;
    errors: IError[];
  }
  export interface IError {
    path: string;
    expected: string;
    value: any;
  }
}

Even when the validation is failed, its origin data should be filled. This PR fills the input data in the `IValidation.IError.data` property.
@samchon samchon added the enhancement New feature or request label Dec 10, 2024
@samchon samchon self-assigned this Dec 10, 2024
Copy link

pkg-pr-new bot commented Dec 10, 2024

Open in Stackblitz

npm i https://pkg.pr.new/typia@1421

commit: 90e4b10

Copy link
Owner Author

@samchon samchon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem.

@samchon samchon merged commit 0e115d5 into master Dec 10, 2024
5 checks passed
@samchon samchon deleted the feat/validate branch December 10, 2024 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant