R.lt – are we that lazy?

I was browsing an old code of mine when I saw this line const removeShortSentences = R.compose( R.lt(3), R.length, R.split(".") ) I was surprised by how unreadable the piece with R.lt is, as all it does is to save a few characters. The same logic without R.lt has much clearer intent: const removeShortSentences = R.compose( … Continue reading R.lt – are we that lazy?

Advertisements

R.partition – extended version of R.filter

R.partition The method is similar to R.filter, but it instead of returning single list with all list members passing the predicate function, it return two lists. First list is the same as the result of R.filter, i.e. all instances of the list passing the predicate. The second list holds all list members that doesn't pass … Continue reading R.partition – extended version of R.filter

Create documentation files with composeAsync and mapAsync

The task Generate documentation from a folder For each Javascript file in the folder generate command for documentation generation Perform the bundle of commands Remove empty documentation files The tools documentation - for documentation generation klaw-sync - for reading the content of the folder fs-extra - for file manipulations rambdax - for flow control child_process … Continue reading Create documentation files with composeAsync and mapAsync