convertToMapOf

fun <T : Any> convertToMapOf(type: KClass<T>): WebcomResult<Map<String, T>>

Converts this DatasyncValue to a Map of a given T type.

If the underlying tree-like value is not a tree but a primitive type (boolean, string or number) or if one of the branches cannot be converted to a T instance, returns a WebcomResult.Failure instance with the error.