- Preparing search index...
- The search index is not available
@nathanpb/kext
- takeIf<T, R>(receiver: T, predicate: boolean | ((it: T) => it is R) | ((it: T) => boolean)): R | undefined
-
Parameters
-
receiver: T
-
predicate: boolean | ((it: T) => it is R) | ((it: T) => boolean)
Returns R | undefined
Applies
receivertopredicate, returnsreceiverif the givenpredicateresolves intotrue, orundefinedotherwise.If
predicateis a boolean, returnsreceivercause truthy orundefinedotherwise.https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/take-if.html
Returns
receiverifpredicate(or it's evaluation) istrue.undefinedotherwise.