summaryrefslogtreecommitdiff
path: root/formats/json-tests/commonTest/src/kotlinx/serialization/test/CurrentPlatform.common.kt
diff options
context:
space:
mode:
Diffstat (limited to 'formats/json-tests/commonTest/src/kotlinx/serialization/test/CurrentPlatform.common.kt')
-rw-r--r--formats/json-tests/commonTest/src/kotlinx/serialization/test/CurrentPlatform.common.kt16
1 files changed, 16 insertions, 0 deletions
diff --git a/formats/json-tests/commonTest/src/kotlinx/serialization/test/CurrentPlatform.common.kt b/formats/json-tests/commonTest/src/kotlinx/serialization/test/CurrentPlatform.common.kt
new file mode 100644
index 00000000..8c3633b4
--- /dev/null
+++ b/formats/json-tests/commonTest/src/kotlinx/serialization/test/CurrentPlatform.common.kt
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2017-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
+ */
+
+package kotlinx.serialization.test
+
+enum class Platform {
+ JVM, JS, NATIVE, WASM
+}
+
+public expect val currentPlatform: Platform
+
+public fun isJs(): Boolean = currentPlatform == Platform.JS
+public fun isJvm(): Boolean = currentPlatform == Platform.JVM
+public fun isNative(): Boolean = currentPlatform == Platform.NATIVE
+public fun isWasm(): Boolean = currentPlatform == Platform.WASM \ No newline at end of file