• Generates two functions for validating Number Ranges. Inputs for this function expects the number filters to be defined under a single key in FilterValues.

    Type Parameters

    • T

    Parameters

    Returns [((key) => FilterValidatorFunction<T>), ((key) => FilterValidatorFunction<T>)]

    Example

    const [createFromValidator, createToValidator] = createNumberRangeValidators<T>();
    const filters = FilterType<T>[] = {
    {
    label: 'Duration (From)',
    property: 'duration',
    type: FilterTypes.Numeric,
    onValidate: createFromValidator('duration'),
    },
    {
    label: 'Duration (To)',
    property: 'duration',
    type: FilterTypes.Numeric,
    onValidate: createToValidator('duration'),
    }
    }

Generated using TypeDoc