Skip to content

i-voted-for-biden2/is-odd.kt

Repository files navigation

is-odd.kt

Kotlin port of very popular JavaScript library is-odd

Kotlin/JS introduced a cool thing to Kotlin which we were all missing before. The dynamic type. But there is only one problem with that. You can no longer figure out whether something is even or odd. So this library introduces a very helpful helper function called isOdd

How this works

  • On Kotlin/JS this uses the very popular library is-odd
  • On all Kotlin/JVM and Kotlin/Native this uses its own implementation: IsOdd.kt

Usage

The library is hosted on Bintray

Gradle:

    kotlin {
        sourceSets {
            commonMain {
                repositories {
                    maven("https://schlaubi.jfrog.io/artifactory/is-odd")
                }
                
                dependencies {
                    implementation("me.schlaubi", "is-odd", "1.2")
                }
            }
        }    
    }

Documentation

Docs can be found here: https://isodd.schlau.bi/is-odd