1 package net.pterodactylus.sone.utils
4 * Returns the value of [block] if `this` is true, returns `null` otherwise.
6 fun <R> Boolean.ifTrue(block: () -> R): R? = if (this) block() else null
9 * Returns the value of [block] if `this` is false, returns `null` otherwise.
11 fun <R> Boolean.ifFalse(block: () -> R): R? = if (!this) block() else null