@leancodepl/validation 9.5.1 → 9.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leancodepl/validation",
|
|
3
|
-
"version": "9.5.
|
|
3
|
+
"version": "9.5.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@leancodepl/cqrs-client-base": "9.5.
|
|
6
|
+
"@leancodepl/cqrs-client-base": "9.5.2"
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {
|
|
9
9
|
"sinon": "15.2.0"
|
|
@@ -6,14 +6,14 @@ export type ReducerDescription<THandlerResult, TReturnValue = THandlerResult> =
|
|
|
6
6
|
export type SpecificValidationError<TErrors extends Record<string, number>, TError extends keyof TErrors> = ValidationError<Record<TError, TErrors[TError]>>;
|
|
7
7
|
export type ValidationErrorHandlerFunc<TErrorsToHandle extends Record<string, number>, THandledErrors extends keyof TErrorsToHandle, TResult> = (errorName: THandledErrors, error: SpecificValidationError<TErrorsToHandle, THandledErrors>) => TResult;
|
|
8
8
|
export type ValidationErrorsHandleFunc<TErrorsToHandle extends Record<string, number>, TInResult> = {
|
|
9
|
-
<THandledErrors extends keyof TErrorsToHandle, TResult>(validationErrors: THandledErrors | THandledErrors
|
|
9
|
+
<THandledErrors extends keyof TErrorsToHandle, TResult>(validationErrors: ReadonlyArray<THandledErrors> | THandledErrors, handler: ValidationErrorHandlerFunc<TErrorsToHandle, THandledErrors, TResult>): ValidationErrorsHandler<Omit<TErrorsToHandle, THandledErrors>, TInResult | TResult>;
|
|
10
10
|
};
|
|
11
11
|
export type ValidationErrorHandlerAllFunc<TErrorsToHandle extends Record<string, number>, THandledErrors extends keyof TErrorsToHandle, TResult> = (errors: {
|
|
12
12
|
errorName: THandledErrors;
|
|
13
13
|
errors: SpecificValidationError<TErrorsToHandle, THandledErrors>[];
|
|
14
14
|
}[]) => TResult;
|
|
15
15
|
export type ValidationErrorsHandleAllFunc<TErrorsToHandle extends Record<string, number>, TInResult> = {
|
|
16
|
-
<THandledErrors extends keyof TErrorsToHandle, TResult>(validationErrors: THandledErrors | THandledErrors
|
|
16
|
+
<THandledErrors extends keyof TErrorsToHandle, TResult>(validationErrors: ReadonlyArray<THandledErrors> | THandledErrors, handler: ValidationErrorHandlerAllFunc<TErrorsToHandle, THandledErrors, TResult>): ValidationErrorsHandler<Omit<TErrorsToHandle, THandledErrors>, TInResult | TResult>;
|
|
17
17
|
};
|
|
18
18
|
export interface ValidationErrorsHandler<TRemainingErrors extends Record<string, number>, TResult> {
|
|
19
19
|
handle: ValidationErrorsHandleFunc<TRemainingErrors, TResult>;
|