Skip to content

Commit 5d760ca

Browse files
committed
feat: allow fieldContext to contain arbritary properties
1 parent f74cea1 commit 5d760ca

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/types.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export type FieldContext = {
137137
* Is this field an array member
138138
*/
139139
isArrayMember: boolean
140-
}
140+
} & Record<string, any>
141141

142142
/**
143143
* The shape of validation rule picked from the
@@ -174,6 +174,11 @@ export type ConditionalFn<Input> = (value: Input, field: FieldContext) => boolea
174174
* Shape of a validation rule accepted by the compiler
175175
*/
176176
export type ValidationNode = {
177+
/**
178+
* Specify the validation node name
179+
*/
180+
name?: string
181+
177182
/**
178183
* Rule implementation function id.
179184
*/

0 commit comments

Comments
 (0)