summaryrefslogtreecommitdiff
path: root/formats/json-tests/commonTest/src/kotlinx/serialization/test/CurrentPlatform.common.kt
blob: 8c3633b4769d29f576ebf639fa69c06a025e2d4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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