XpmInitTemplateBase._validatePropertyValue() method
Validates a property value against its definition.
Signature
protected _validatePropertyValue(name: string, value: string): string | boolean | number;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
name |
string |
The property name to validate. |
|
value |
string |
The property value to validate. |
Returns
string | boolean | number
The validated and potentially converted value (string, boolean, or number).
Exceptions
XpmError If the property is unsupported or the value is invalid.
Remarks
This method checks whether the provided value is valid for the specified property according to its type definition. It performs type-specific validation and conversion:
- For
selectproperties: validates against allowed items andchecks platform compatibility if specified - For
booleanproperties: converts'true'/'false'strings to booleans - For
numberproperties: converts strings to numbers
If the value is empty and a default is defined, the default value is returned. For select properties with platform restrictions, only platform-compatible items are considered valid.
Generated via tsdoc2docusaurus 1.3.0-pre by API Extractor/Documenter 7.55.2.