:constrution: 🎨 leave out empty strings

This commit is contained in:
Kevin Van Der Werff
2019-10-21 17:28:27 +02:00
parent 5925666496
commit 61d2c92dee
2 changed files with 11 additions and 3 deletions

View File

@@ -4,6 +4,7 @@
<script>
import * as R from 'ramda'
import { isNotEmpty } from '../utils/pure'
export default {
data() {
@@ -12,11 +13,11 @@ export default {
}
},
watch: {
searchInput(e) {
searchInput(input) {
const isTag = R.startsWith('#')
const removeFirstChar = x => R.splitAt(1, x)[1]
const words = R.split(' ', e)
const words = R.filter(isNotEmpty, R.split(' ', input))
const tags = R.filter(isTag, words)
const titles = R.filter(R.compose(R.not, isTag), words)
console.group()

View File

@@ -49,4 +49,11 @@ const partiallyIncludesElOf = R.curry((list1, list2) =>
list2)
)
export { getAllResources, tagsNotEmpty, includesElOf, partiallyIncludesElOf, cleanString }
export {
isNotEmpty,
getAllResources,
tagsNotEmpty,
includesElOf,
partiallyIncludesElOf,
cleanString
}