Skip to content

Commit

Permalink
ci: apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Jul 29, 2024
1 parent 6d25b8c commit eaa85e4
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 51 deletions.
2 changes: 1 addition & 1 deletion examples/angular/simple/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type {
[validators]="{
onChange: firstNameValidator,
onChangeAsyncDebounceMs: 500,
onChangeAsync: firstNameAsyncValidator
onChangeAsync: firstNameAsyncValidator,
}"
#firstName="field"
>
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/valibot/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import * as v from 'valibot'
[validators]="{
onChange: firstNameValidator,
onChangeAsyncDebounceMs: 500,
onChangeAsync: firstNameAsyncValidator
onChangeAsync: firstNameAsyncValidator,
}"
#firstName="field"
>
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/yup/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import * as yup from 'yup'
.string()
.min(3, 'First name must be at least 3 characters'),
onChangeAsyncDebounceMs: 500,
onChangeAsync: firstNameAsyncValidator
onChangeAsync: firstNameAsyncValidator,
}"
#firstName="field"
>
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/zod/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { z } from 'zod'
.string()
.min(3, 'First name must be at least 3 characters'),
onChangeAsyncDebounceMs: 500,
onChangeAsync: firstNameAsyncValidator
onChangeAsync: firstNameAsyncValidator,
}"
#firstName="field"
>
Expand Down
6 changes: 3 additions & 3 deletions packages/angular-form/tests/test.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe('TanStackFieldDirective', () => {
(blur)="f.api.handleBlur()"
(input)="
f.api.setValue($any($event).target.value, {
dontUpdateMeta: true
dontUpdateMeta: true,
})
"
/>
Expand Down Expand Up @@ -208,7 +208,7 @@ describe('TanStackFieldDirective', () => {
(blur)="f.api.handleBlur()"
(input)="
f.api.setValue($any($event).target.value, {
dontUpdateMeta: true
dontUpdateMeta: true,
})
"
/>
Expand Down Expand Up @@ -313,7 +313,7 @@ describe('TanStackFieldDirective', () => {
[defaultMeta]="{ isTouched: true }"
[validators]="{
onChangeAsync: onChangeAsync,
onBlurAsync: onBlurAsync
onBlurAsync: onBlurAsync,
}"
#f="field"
>
Expand Down
78 changes: 40 additions & 38 deletions packages/form-core/src/FieldApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,33 +42,34 @@ export type FieldValidateOrFn<
| Validator<TParentData, unknown>
| undefined = undefined,
TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>,
> = TFieldValidator extends Validator<TData, infer TFN>
?
| TFN
| FieldValidateFn<
TParentData,
TName,
TFieldValidator,
TFormValidator,
TData
>
: TFormValidator extends Validator<TParentData, infer FFN>
> =
TFieldValidator extends Validator<TData, infer TFN>
?
| FFN
| TFN
| FieldValidateFn<
TParentData,
TName,
TFieldValidator,
TFormValidator,
TData
>
: FieldValidateFn<
TParentData,
TName,
TFieldValidator,
TFormValidator,
TData
>
: TFormValidator extends Validator<TParentData, infer FFN>
?
| FFN
| FieldValidateFn<
TParentData,
TName,
TFieldValidator,
TFormValidator,
TData
>
: FieldValidateFn<
TParentData,
TName,
TFieldValidator,
TFormValidator,
TData
>

/**
* @private
Expand Down Expand Up @@ -102,33 +103,34 @@ export type FieldAsyncValidateOrFn<
| Validator<TParentData, unknown>
| undefined = undefined,
TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>,
> = TFieldValidator extends Validator<TData, infer TFN>
?
| TFN
| FieldValidateAsyncFn<
TParentData,
TName,
TFieldValidator,
TFormValidator,
TData
>
: TFormValidator extends Validator<TParentData, infer FFN>
> =
TFieldValidator extends Validator<TData, infer TFN>
?
| FFN
| TFN
| FieldValidateAsyncFn<
TParentData,
TName,
TFieldValidator,
TFormValidator,
TData
>
: FieldValidateAsyncFn<
TParentData,
TName,
TFieldValidator,
TFormValidator,
TData
>
: TFormValidator extends Validator<TParentData, infer FFN>
?
| FFN
| FieldValidateAsyncFn<
TParentData,
TName,
TFieldValidator,
TFormValidator,
TData
>
: FieldValidateAsyncFn<
TParentData,
TName,
TFieldValidator,
TFormValidator,
TData
>

export interface FieldValidators<
TParentData,
Expand Down
14 changes: 8 additions & 6 deletions packages/form-core/src/FormApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ export type FormValidateFn<
export type FormValidateOrFn<
TFormData,
TFormValidator extends Validator<TFormData, unknown> | undefined = undefined,
> = TFormValidator extends Validator<TFormData, infer TFN>
? TFN
: FormValidateFn<TFormData, TFormValidator>
> =
TFormValidator extends Validator<TFormData, infer TFN>
? TFN
: FormValidateFn<TFormData, TFormValidator>

/**
* @private
Expand All @@ -59,9 +60,10 @@ export type FormValidateAsyncFn<
export type FormAsyncValidateOrFn<
TFormData,
TFormValidator extends Validator<TFormData, unknown> | undefined = undefined,
> = TFormValidator extends Validator<TFormData, infer FFN>
? FFN | FormValidateAsyncFn<TFormData, TFormValidator>
: FormValidateAsyncFn<TFormData, TFormValidator>
> =
TFormValidator extends Validator<TFormData, infer FFN>
? FFN | FormValidateAsyncFn<TFormData, TFormValidator>
: FormValidateAsyncFn<TFormData, TFormValidator>

export interface FormValidators<
TFormData,
Expand Down

0 comments on commit eaa85e4

Please sign in to comment.