Skip to content

Instantly share code, notes, and snippets.

@andrewglind
Last active October 15, 2017 19:04
Show Gist options
  • Save andrewglind/d5071694d28cb2e91a4b63f146d5d6cf to your computer and use it in GitHub Desktop.
Save andrewglind/d5071694d28cb2e91a4b63f146d5d6cf to your computer and use it in GitHub Desktop.
Extension function to convert HashMap<String, Any> to JS Object
fun HashMap<String, Any>.toJson(): Json {
val js = json()
this.forEach { (k, v) -> js.set(k, v) }
return js
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment