Helper method used when splicing literal json strings.
Helper method used when splicing literal json strings.
This avoids the double-comma which would otherwise occur when we splice an empty Iterable or Option. For example:
val xs = Nil json"[ 1, ..$xs, 2 ]"
Naively using the empty string for xs would give [12]. Hence, if while coalescing we encounter an empty string and the next character is a comma, we drop the comma.