:constrution: 🎨 leave out empty strings
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as R from 'ramda'
|
import * as R from 'ramda'
|
||||||
|
import { isNotEmpty } from '../utils/pure'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@@ -12,11 +13,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
searchInput(e) {
|
searchInput(input) {
|
||||||
const isTag = R.startsWith('#')
|
const isTag = R.startsWith('#')
|
||||||
const removeFirstChar = x => R.splitAt(1, x)[1]
|
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 tags = R.filter(isTag, words)
|
||||||
const titles = R.filter(R.compose(R.not, isTag), words)
|
const titles = R.filter(R.compose(R.not, isTag), words)
|
||||||
console.group()
|
console.group()
|
||||||
|
|||||||
@@ -49,4 +49,11 @@ const partiallyIncludesElOf = R.curry((list1, list2) =>
|
|||||||
list2)
|
list2)
|
||||||
)
|
)
|
||||||
|
|
||||||
export { getAllResources, tagsNotEmpty, includesElOf, partiallyIncludesElOf, cleanString }
|
export {
|
||||||
|
isNotEmpty,
|
||||||
|
getAllResources,
|
||||||
|
tagsNotEmpty,
|
||||||
|
includesElOf,
|
||||||
|
partiallyIncludesElOf,
|
||||||
|
cleanString
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user