Work out fixme in the example

This commit is contained in:
jos 2020-01-04 10:46:21 +01:00
parent e09fde628b
commit 40d312b987
1 changed files with 2 additions and 1 deletions

View File

@ -54,7 +54,8 @@
let query = 'data' let query = 'data'
if (filter) { if (filter) {
// FIXME: parse filter.value either as string or number // note that the comparisons embrace type coercion,
// so a filter value like '5' (text) will match numbers like 5 too.
query = `_.filter(${query}, item => _.get(item, '${filter.field}') ${filter.relation} '${filter.value}')` query = `_.filter(${query}, item => _.get(item, '${filter.field}') ${filter.relation} '${filter.value}')`
} }