jvmMain.com.adamratzman.spotify.utils.PlatformUtils.kt Maven / Gradle / Ivy
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2022; Original author: Adam Ratzman */
package com.adamratzman.spotify.utils
import kotlinx.coroutines.runBlocking
import java.net.URLEncoder
internal actual fun String.encodeUrl() = URLEncoder.encode(this, "UTF-8")!!
/**
* The actual platform that this program is running on.
*/
public actual val currentApiPlatform: Platform = Platform.Jvm
public actual typealias ConcurrentHashMap = java.util.concurrent.ConcurrentHashMap
public actual fun ConcurrentHashMap.asList(): List> = toList()
public actual fun runBlockingOnJvmAndNative(block: suspend () -> T): T {
return runBlocking { block() }
}