JS tests for addClass, removeClass, removeFromParent

This commit is contained in:
Sergey Mashkov
2015-05-12 14:34:19 +03:00
committed by Sergey Mashkov
parent bcbfa3c240
commit a11e0a84b5
9 changed files with 131 additions and 89 deletions
@@ -145,7 +145,7 @@ fun betterFunction(f1: GenerateFunction, f2: GenerateFunction): GenerateFunction
)
private fun <F, T> Pair<F, F>.map(block: (F) -> T) = block(first) to block(second)
private fun Pair<String, String>.betterType() = if (listOf("dynamic", "Any", "Any").any { first.contains(it) }) first else second
private fun Pair<String, String>.betterType() = if (listOf("dynamic", "Any").any { first.contains(it) }) first else second
private fun Pair<String, String>.betterName() = if (((0..9).map { it.toString() } + listOf("arg")).none { first.toLowerCase().contains(it) }) first else second
fun <K, V> List<Pair<K, V>>.toMultiMap(): Map<K, List<V>> = groupBy { it.first }.mapValues { it.value.map { it.second } }