@stacksjs/validation 0.58.51 → 0.58.53
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 +1 -1
- package/src/rules.ts +3 -3
package/package.json
CHANGED
package/src/rules.ts
CHANGED
|
@@ -28,7 +28,7 @@ export interface FieldContext {
|
|
|
28
28
|
/**
|
|
29
29
|
* Mutate the value of field under validation.
|
|
30
30
|
*/
|
|
31
|
-
mutate(newValue: any, field: FieldContext)
|
|
31
|
+
mutate: (newValue: any, field: FieldContext) => void
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Report error to the error reporter
|
|
@@ -87,12 +87,12 @@ export interface ErrorReporterContract {
|
|
|
87
87
|
/**
|
|
88
88
|
* Creates an instance of an exception to throw
|
|
89
89
|
*/
|
|
90
|
-
createError()
|
|
90
|
+
createError: () => Error
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
93
|
* Report error for a field
|
|
94
94
|
*/
|
|
95
|
-
report(message: string, rule: string, field: FieldContext, args?: Record<string, any>)
|
|
95
|
+
report: (message: string, rule: string, field: FieldContext, args?: Record<string, any>) => any
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
export const isMoney = validator.createRule((value: unknown, _, field: FieldContext) => {
|