index/functions/validateOptionalTokenName.md
validateOptionalTokenName(
tokenName,field,constraint):void
Validates an optional token name (allows undefined/null, but validates if present)
Use this for optional token name fields that should be validated when provided.
token name
Parameters
| Parameter | Type | Description |
|---|---|---|
tokenName | unknown | The token name to validate (may be undefined/null) |
field | string | The field name for error messages |
constraint | TokenNameConstraint | The route's token name constraint |
token name constraint
Returns
void
Throws
If token name is provided but invalid
Since
6.12.0