diff --git a/src/index.ts b/src/index.ts index b2164250..bba7dd9c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -60,9 +60,13 @@ export const failures: (errors: Errors) => Validation = left * @category Decode error * @since 1.0.0 */ -export const failure = (value: unknown, context: Context, message?: string): Validation => +export let failure = (value: unknown, context: Context, message?: string): Validation => failures([{ value, context, message }]) +export const setFailureImplementation = (impl: (value: unknown, context: Context, message?: string) => Validation): void => { + failure = (impl as any) +} + /** * @category Decode error * @since 1.0.0