testToNormalizeValue<
T
>(filter
): (value
) => typeofINVALID_VALUE
|T
Check if a value respects a provided type guard.
• T
• filter
the guard function
Function
a function that takes a value as input, checks if it respects the type guard and returns INVALID_VALUE
otherwise
• value: any
typeof INVALID_VALUE
| T
const
typeArray:WritableWithDefaultOptions
<any
[]>
const
typeBoolean:WritableWithDefaultOptions
<boolean
>
const
typeBooleanOrNull:WritableWithDefaultOptions
<boolean
|null
>
const
typeFunction:WritableWithDefaultOptions
<(...args
) =>any
>
const
typeHTMLElementOrNull:WritableWithDefaultOptions
<HTMLElement
|null
>
const
typeNumber:WritableWithDefaultOptions
<number
>
typeNumberInRangeFactory(
min
,max
,options
):WritableWithDefaultOptions
<number
>
Factory function for creating a type constraint for numbers within a specified range.
• min: number
The minimum value.
• max: number
The maximum value.
• options: TypeNumberInRangeOptions
= {}
Additional options to customize the behavior.
WritableWithDefaultOptions
<number
>
A type guard function that returns the clamp value or INVALID_VALUE depending on the provided options.
optional
strict:boolean
If true
, the range checking will be strict, excluding the minimum and maximum values. Default is false
.
optional
useClamp:boolean
If true
, values outside the range will be clamped to the minimum or maximum. Default is true
.
const
typeString:WritableWithDefaultOptions
<string
>