makeJSONObject

fun makeJSONObject(value: Any?): Any?

Converts a Kotlin style value to a JSON-ready form for Mapbox style payloads and debugging.

Expressions become arrays/objects; Anchor/LineJoin/LineCap become strings; Compose colors become rgba(...); lists and maps are converted recursively. Unrecognized values pass through.