Last active
October 15, 2017 19:04
-
-
Save andrewglind/d5071694d28cb2e91a4b63f146d5d6cf to your computer and use it in GitHub Desktop.
Extension function to convert HashMap<String, Any> to JS Object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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