Skip to main content

InitTemplateBase.validatePropertyValue() method

Validates a property value against its definition.

Signature​

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​

ConfigurationError 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 select properties: validates against allowed items andchecks platform compatibility if specified
  • For boolean properties: converts 'true'/'false' strings to booleans
  • For number properties: 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.2 by API Extractor/Documenter 7.57.2.