Yan Pujante
09/19/2021, 8:15 PMval templateEngine: dynamic = js("Sqrl")
templateEngine.render(content, tokens)
The issue is that tokens
is a Map<String, String>
and Sqrl is not happy with it... I used this code to workaround the issue:
val data: dynamic = js("{}")
tokens.forEach { e -> val k = e.key; val v = e.value; js("data[k] = v") }
templateEngine.render(content, data)
which works... But this seems so hacky. Is there a better way?Yan Pujante
09/19/2021, 8:29 PMturansky
09/19/2021, 9:21 PMiterator
operatorturansky
09/19/2021, 9:31 PMYan Pujante
09/20/2021, 12:17 AMturansky
09/20/2021, 6:32 AMRecord
type if you have plain Object