writePairsAsArrayOfPairs

fun <First, Second> writePairsAsArrayOfPairs(pairs: Iterator<Pair<First, Second>>, pairTransformer: (First, Second) -> Pair<JSONFriendly, JSONFriendly>)

Write an Iterator of Pairs keyed by an arbitrary type to another arbitrary type as a JSONArray of JSONArray pairs with the map keys as the first element in the JSONArray pair and the value as the second element in the JSONArray pair transformed into JSONFriendly - JSONFriendly pairs by the provided lambda.

Parameters

First

The type of the Map's key.

Second

The type of the Map's value.

pairs

The Iterator of Pairs to serialize into this JSONWriter.

pairTransformer

Accepts the map key and the associated value and answers a Pair of JSONFriendly to JSONFriendly that are written in pair order to the JSONArray pair.