Skip to main content
Version: 0.1.1

Function: custom()

Imported from @react-logic/utils

custom<T, N>(name, fn, message?, htmlAttrs?): ValidatorEntry<T> & object

Build a custom-named validator entry. Useful when you want literal-name inference without the inline-object pattern, or to attach htmlAttrs to your own rules.

Type Parameters

T

T

N

N extends string

Parameters

name

N

fn

(value) => boolean

message?

string

htmlAttrs?

HTMLValidationAttrs

Returns

ValidatorEntry<T> & object