validateSetting Method
Ensure that the setting value supplied is valid according to its SettingSchema. If no schema has been registered for the setting, no validation is performed.
validateSetting<T>(value: T, settingName: string): T
@returns value
if value
matches the schema corresponding to settingName
, or if no such schema has been registered.
@throws Error if value
is invalid according to the schema.
Parameter | Type | Description |
---|---|---|
value | T | The value of the setting to validate against the schema. |
settingName | string | The fully-qualified setting name. |
Returns - T
value
if value
matches the schema corresponding to settingName
, or if no such schema has been registered.
Defined in
Last Updated: 23 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.