toSchemaType

[ Function ]

Version 1.8

public static toSchemaType(
    value: any,
    schema: TcHmi.JsonSchema | null
): any | null;

Version 1.12

public static toSchemaType(
    value: any,
    schema: TcHmi.JsonSchema | null
    options?: {
        readonly convertDirection?: ValueConverter.ConvertDirection;
    }

): any | null;

Converts any compatible value to a type defined by a schema object.

Parameter

Name

Type

Description

value

any

The value to convert.

schema

TcHmi.JsonSchema

The schema object.

options [ optional ]

Available from version 1.12

 

{
    readonly convertDirection?: ValueConverter.ConvertDirection;
}

Settings

Return value

Type

Description

any, null

The value corresponding to the schema object or null in the event of an error.

toSchemaType 1:

Available from 1.8