All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.Filter.kt Maven / Gradle / Ivy

The newest version!
package com.juul.krayon.selection

import com.juul.krayon.element.Element

public inline fun  Selection.filter(
    crossinline filter: E.(Arguments) -> Boolean,
): Selection {
    val arguments = Arguments.Buffer()
    return Selection(
        groups.map { group ->
            Group(
                group.parent,
                group.nodes.mapIndexedNotNull { index, node ->
                    node?.takeIf { node.filter(arguments(node.data as D, index, group.nodes)) }
                },
            )
        },
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy