isStringLength()
Last updated
Was this helpful?
Last updated
Was this helpful?
isStringLength()
Checks if value is a type or an instance of (by using ) of a specified length.
Type
extends
AnyString
=
string
Length
extends
number
Payload
extends
object
=
object
value: any
length: Length
callback: ResultCallback<any, { length: Length } & Payload>
payload?: Payload
value is StringOfLength<Length, Length, Type>
string
typeString
instanceA generic type variable Type
constrained by indicates the type of the given via the .
A generic type variable Length
constrained by the type, by default of value captured from the supplied indicates the length of the provided via the and the fixed shape of optional parameter of the provided function.
The Payload
generic type variable constrained by indicates the type of optional parameter of the supplied function and optional parameter of the function from which it captures its value.
The value of type to check.
The length of generic type variable of a given .
A callback function
of type with parameters, the that has been checked, the of this check, and of generic type variable with optional properties from the provided , to handle them before the return. By default, it uses function.
The parameter of the function consists of the property given in parameter of the core function, and it can't be overwritten by the given parameter of the core function.
An optional of the generic type variable is assigned to the of the given function.
The return type is a as the result of its statement indicating the is a generic type that takes generic type variables Min
and Max
from the generic type variable as the length of the supplied , and generic type variable as the type of the provided .
The return value is a indicating whether the provided is a type or an instance of of the specified length.